Fix race condition that could kill connections before they were initiated

Copied from the commit description:

Because NetworkManagers are registered before they get their channel in channelActive, the ServerConnection would remove them sometimes because it thought they were disconnected. This commit fixes this by introducing a 'preparing' variable that is true while the NetworkManager is not initialized. The ServerConnection does not remove NetworkManagers with this flag.