Search for associated production of dark matter with a Higgs boson decaying to b bbar or gamma gamma at sqrt(s)=13 TeV