Fix inconsistent back button behavior

By default, a press of the back button will only take effect when the
button is successfully released (the user releases the button while
still focused on it), not when the button is still triggered and pressed
down. To avoid this inconsistent behavior, execute the custom back
logic in the onBackPressed callback instead of onKeyDown.

Change-Id: Id516bc523b625a7ca42ea3ff580892cdf28f770f