Callbacks for Invalid Username and Password

Hi,
I've made a small change to add callbacks for login errors. Our code will reconnect after a connection failure, but I find it useful to not do so in the case of a login failure causing the disconnect.

Thanks,
Mal