add missing OF portnumber checks for attach_port_to_switch and connect_switches