Make pyboard.enter_raw_repl more robust

In case there's a program in the microcontroller's main.py running in an infinite loop
Merge pull request #543 from lurch/patch-4

Make pyboard.enter_raw_repl more robust