Use std::unique_ptr instead of ScopeGuard

Bug: 302723053
Test: mma
Change-Id: I27226885b8b5e771d675ba2d83d0a2e14551d13e
10 files changed