Replace LIBMTP_file_t with CreateScopedMtpFile.

CreateScopedMtpFile is a std::unique_ptr with a custom deleter that
calls LIBMTP_destroy_file_t() so one does not need to call it manually.

Use std::unique_ptr in other places where possible.

BUG=none
TEST=none

Change-Id: I752ff37eadeb3cd6aa9df9c83444805d3995d027
Reviewed-on: https://chromium-review.googlesource.com/493872
Commit-Ready: Lei Zhang <thestig@chromium.org>
Tested-by: Lei Zhang <thestig@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
1 file changed