I ran into this problem too. The way to fix it is to stop the host application from unloading the plugins before it exits. In my case I was trying to profile C modules for Lua and Lua was unloading the modules when the VM exited normally. To fix this issues I had the script call os.exit() to do a forced shutdown.
Either disable plugin unloading in the plugin container, or create a plugin the allows you to force the application to exit (calling _exit(0)).