Make StorageFactory destructor dlclose all storage plugins

The code is now generic and will handle situation when we later add more
kinds of storages, other than filesystem. Also fixes possible
application crash when there weren't any plugin loaded.