Guard recursion flag against exceptions.

To avoid misleading errors in case of failed initialization,
flags used to protected against recursion need to be reset
in case of an exception being thrown.

Change-Id: Ifbc1db4b827012177fcfd271981179ebb2329b52