e06dd39d89
Set handler state to terminated before exiting. Also simplify scratch handler exit loop. Change-Id: I0a80c8a1899e8b60a6e7aa6989ba28de42ba31e7