Correctly attach the debugger to a running VM.

Fixed #1001639.
Merge pull request #412 from dragos/issue/debugger-attach-1001639

Correctly attach the debugger to a running VM.