Merge memory leak fixes from AOSP