Fixed problem when custom registered mechanism is used.

User-defined mechanisms should be tested first. Added function to
determine whether a mechanism is built-in.
Added support for initial response in SASL authentication.