Prevent network request thread from exiting prematurely on OS X

This is a fix to prevent network request thread from exiting prematurely on OS X. I also add back an autorelease pool to wrap the thread entry routine as I explained in issue #1077, according to the [Threading Programming Guide](https://developer.apple.com/library/ios/#documentation/Cocoa/Conceptual/Multithreading/CreatingThreads/CreatingThreads.html#//apple_ref/doc/uid/10000057i-CH15-SW17).