Replaced std::auto_ptr with std::unique_ptr.

See http://herbsutter.com/2013/05/29/gotw-89-solution-smart-pointers/.