Add onCreate hook

This hook will be called immediately after a connection object is created,
but before the connection is made (onConnect). This hook is useful if you
want to listen to error event of the connection object while the connection is established.