For the first time, gay and bisexual men who don’t inject drugs accounted for less than half of new HIV cases in San Francisco last year.