This actually happens because
device = MonkeyRunner.waitForConnection()
returns with no error or exception even when the connection was not successful.
You can use the same technique used by AndroidViewClient/culebra to detect if the connection has been done just after waitForConnection()
:
try:
device.wake()
except java.lang.NullPointerException, e:
print >> sys.stderr, "%s: ERROR: Couldn't connect to %s: %s" % (progname, serialno, e)
sys.exit(3)