contrib/cap_sasl.pl: rename `state` to `step` as other SASL implementations call it
contrib/cap_sasl.pl: make the code less repetititive
contrib/cap_sasl.pl: do not crash if timeout happens after disconnecting