If remote router disconnects while still being in Unkonwn state reconnect
to the router after disconnecting. This should prevent the bugs where
server doesn't reconnect to router after being disconnected at the early
connection state.
Fixed various memory allocation failure handlings.