The easy solution is to install a GFCI. It does not have to be bonded. The ground, if used does not have to be within 5 of the entrance of the water pipe into the building.
The five foot rule applies when you are using the water pipe as a grounding electrode. Bonding of the recptacle ground is a different rule. See 250.130(C) and 406.#(D).
One disadvantage of using a GFCI on a non grounded circuit is for some applications a ground is required, such as a TVSS. But using a GFCI is better than having the ground prong cut off a male cord cap.