Properly release added resource loader and save references. Otherwise PluginScript API may cause "ObjectDB Instances still exist!" warnings and segmentation faults on exit.