debugger: ensure state machine is idle during startup

This improves reliability when entering the debugger.