Improve BNetworkConnection

Add waitForConnected() and waitForDisconnected() methods to
BNetworkConnection.