Do not overwrite the authdb, especially not when its $external buddy
Use the errorstring for that errorcode
Pass correct length to sasl_decode64() to not make it mad in old versions
Generously log things for debugging