The GUAPOS project: G31.41+0.31 unbiased ALMA sPectral observational survey: IV. Phosphorus-bearing molecules and their relation to shock tracers