Copied scoped_ptr and scoped_array from google mock

also changed code to use them