Properly cleanup plug-ins when failing to register them