Detect serial device disconnect on linux while polling

This should fix #386. I'm not really sure if the callback is called from the right thread...