Exit when back is pressed with only one page in the backstack

Change-Id: Iec802eb0473ce5b8d6a7ab9d44ad81ade9f71403
Merge "Exit when back is pressed with only one page in the backstack"