mavconn: Emit port_closed after thread stop.

Also use tx state flag, improve error messages and move io post out of
critical section.

Issue #72.