Bugs with F7 fixed

Bug with holding or quickly pressing F7 (garbage in debugger's output)
in debugger fixed.
Bug with pressing F7 quickly after "Ctrl+D" (leads to not working debug
mode) in debugger fixed.