fix client hangs on wrong password

This is the fix for Michael's retry and test bugs.