tcp: don't crash when tcp server cannot be registered, fixes #2315