Search for rare decays of Z and Higgs bosons to J/ and a photon in proton-proton collisions at 13 TeV