It is known that when we deny permissions at runtime in Android 6.0 and resume the app from the recent menu, the app process
I don't know if anyone is still looking for an answer on this, but I'd solve by reversing the logic, instead of waiting for a flag indicating the restart/recreate due to the denial of permission, pass a flag indicating that the Activity was started by another Activity and not recreated by the system. So if FLAG doesn't come in extras then the activities stack must be destroyed and first activity lauched.
Hope it helps someone.