Add support for non-application threads

I reverted recent commit and I fix the crash when application finishes by not setting parent to the proxies.
I don't think it is worth to set parent to QCoreApplication just in the application thread.