This might be a bug in the Linux kernel driver that doesn't like the serial port being disconnected while a command is attached.