Create MainLoop thread through a thread factory

Environments such as GAE can provide their own
factories that use, say, custom restricted
thread managers.