VerifyInputEventTest: send UPs even on failure

A failure in testDeviceIdBecomesVirtualForInjectedMotions was causing
subsequent tests to fail because its injected pointer wasn't lifted. Use
try ... finally blocks to always lift pointers or release keys even if
an exception occurs.

Bug: 398430906
Test: $ atest CtsViewTestCases:android.view.cts.VerifyInputEventTest
Test: throw a RuntimeException in one test, check subsequent ones pass
Flag: TEST_ONLY
Change-Id: I8e6462c0970361c8c96cfce68986292a871bdb13
1 file changed