saslserv/main: Fix unlikely buffer overflow in sasl_packet()

An incorrect length check allows for out of bounds stack writes when the mechanism list gets too long.
This is not triggerable by users.
Merge pull request #315 from attilamolnar/release/7.1+sasl-buffer-overflow-fix

saslserv/main: Fix unlikely buffer overflow in sasl_packet()