Recursive mutex for PluginManager

This fixes the problem with the previous commit which added thread safety to the plugin system. The last commit failed becuase a plugin was requested to be loaded while we were in the process of loading an earlier plugin request. This code uses a recursive mutex which will allow the job to proceed.