Fixes Android builds on MacOSX.
Changes deprecated std::auto_ptr usage replacing with std::unique_ptr from C++11.