Study of jet quenching with isolated-photon+jet correlations in PbPb and pp collisions at sNN=5.02 TeV