Updating the P4Switch class to use different mechanism for checking when the switch is listening on the Thrift port. This might fix an issues where Mininet hangs on start.