Reactions of compounds of trivalent phosphorus with N-haloamides