Pass connection errors to callback

Studio and loopback-workspace call `connect` to check if the connection parameters are correct.

Before this change, the Node process crash when connection fails. After this change, the connection error is reported via the callback.

/to @raymondfeng