Fix rare cases of the NetworkController raising exceptions.

Found two cases where the NetworkController would throw exceptions due to multithreading issues.

1) A SocketException could appear if the main thread shut down the socket just before the ListenerThread reported an incoming ConnectionEvent. The solution was to let the exception bubble back up to the ListenerThread and let it deal with it.

2)  A ConcurrentModificationException could appear if a ConnectionEvent arrived at the server (and thus adds to the peers list), while the server is iterating through the list to send messages. Easy solution was to just make the send and receive methods synchronized.

@oharaandrew314 to review please