I don't know if it's "safe" or not... that's a word that means different things to different people.
But I'd say your wiring is a hack, and should be fixed. The "grounding wire" is supposed to connect back to the source of the power, not just "the ground".
Despite popular notions, electricity wants to return to its source, not the ground. The ground wire is there to attach anything with a metal exterior to a low resistance path back to the electrical source so if a live wire touches it, the breaker will trip instead of remaining live and potentially electrocuting someone.
Does that pipe outside connect back to your panel (thus to the neutral wire coming into your house)? I don't know... maybe? Maybe it is today, but maybe tomorrow you hire a plumber and that replace a section of pipe with PEX.
Your GFCI hookup likely makes things a bit safer, but it seems a bit impermanent, and hackish to me. Someone staying at your house could easily remove it because it's in the way, etc, and then you're back to having a strange, possibly false ground wire. You should likely replace your setup with a GFCI outlet, and remove the weird hack wire. The NEC code allows you to do this.
Alternatively, you could just disconnect the whole weird contraption, and have a two prong outlet with no ground. You couldn't hook up any three prong equipment to it, but a lot of electrical equipment is 2 prong only, so this isn't terrible. This option is likely a bit more dangerous than putting in a GFCI, but is a bit safer than the weird hack you have now.