Fix infinite loop in *WaitForDebug #3676
Merge branch 'V8_0-wait-for-debug-fix' into V8_0-branch