Serial ports in protected mode are talked to using device drivers. That's what device drivers are for!
This code does not have a timeout:
while(!(inp(open_port + SERIAL_LSR) & 0x20)){}
It waits until the bit on that (virtual) port becomes set, or until you turn off the computer.
Maybe take a step backwards: What are you trying to do in the first place? Is there another way of accomplishing that?