std::auto_ptr is deprecated in c++11/c++0x

This will use std::unique_ptr on C++11 and remove deprecation warning.