Delete QProcess after the process has finished

It's is still used for in-process plugins although since the code unloading the libraries is commented out, it doesn't really affect anything anymore. But the purpose of this change is to fix the leak, not to improve the code.