Disconnecting charger while Macbook Pro Retina is still turned on
Absolutely it is safe.

It has been designed for that, it does not have a locked in plug, but a magnetically coupled plug for that reason.

I have done that on purpose or by accident (tripping over the cable) many times without problems.