Fixed #1456.
Fixes Android builds on MacOSX.
Changes deprecated std::auto_ptr usage replacing with std::unique_ptr from C++11.
Fixes std::thread not working with clang compiler on Android in NDK r8/r9.
Minor variable rename for consistency.
Merge pull request #1506 from seanpaultaylor/next

Next