Fixing exception when applying transaction while the surface is released

> Check surface before applying transaction
> Keeping the release check around even if it release true the first time, as some other check may defer release
> Waiting on animation complete before releasing a surface

Bug: 148885018
Bug: 148194313
Change-Id: Ieb2b98492ff7df165e6b28a108b5f2cbc7ded32d
11 files changed