port_close throws badarg if the port is not open