fixed prompt(), and handle socket exception on slave.quit()
put mutex back before slavepulse readline()