cpp bindings: Null-checks when server/server_thread fails to start.

No chance to set the error context before it is called, so we can't
assume the context pointer is valid.  Unfortunately this means the
error handler will not get called for example when the port is
unavailable.