Measurement of isolated photon-hadron correlations in sNN = 5.02 TeV pp and p -Pb collisions