There are ways to handle it. For example, before it is firmly plugged you can just sense what is happening -- us minimum voltage and high impedance to prevent sparking and to get information about the state of the mating.
You only turn on actual power when it is firmly connected and you turn it off immediately when there is any signal that it might be disconnecting.