altosuilib: Make sure only one thread is closing serial device