Avoid creating new instance on top when started for result in some cases

A new activity instance was created when the task top activity with launch
mode singleTop started itself via startActivityForResult.

Also an activity with launchMode singleInstance was created and added on
top of another activity if it was started via startActivityForResult().

Bug: 122967919
Bug: 122968776
Test: atest IntentTests
Change-Id: I923a0d9aae62dc44c796b7f1c9327dd35dd658bb
1 file changed