Merge "Finish pending activity or dialog when the current session ends"