Master integrals for the two-loop light fermion contributions to ggH and Hγγ