Fix memory leak of Test objects.
am: ee59d49576

Change-Id: Ibad8c7f45dc51200a4efe847ca02539fa03ff7b1