Fix incorrect handling of pending activity and state management

StkMenuActivity for secondary menu and StkInputActivity currently
register theirselves as pending activity, but it is never unregistered
by theirselves. Pending activity should be unregistered when it is
brought back to the foreground unless terminal response has already been
sent to the card.

Bug: 113367485
Test: Manually confirmed that the pending activity works as expected.

Change-Id: I335d1867c121191b31d8436eea4982a7d45a1c90
3 files changed