Dr. Hamburg, a former New York City health inspector, faced a largely friendly audience at a Senate confirmation hearing.