Check for the onUserAuthenticate function before calling it.

onUserAuthenticate is not called in the usual way that events get triggered (by the dispatcher) and, as such, it can cause a crash if you have an authentication plugin that doesn't implement the function. This patch fixes that.

You might think, "Why have an authentication plugin that doesn't handle authentication?" and the answer is that you might have one that only needs to handle authorization. As it is, if you write such a plugin, you would need to throw in an empty 'onUserAuthenticate' function in order to avoid a crash.