Search for exclusive Higgs and Z boson decays to phi gamma and rho gamma with the ATLAS detector