You are aware that both slots will be called for each click, right?
Maybe closing the port aborts sending any bytes that have not been sent yet.
I.e. if write() is not synchronous the stop message might still be on the PC side and close might simply discard it.
Cheers,
_
Bookmarks