Changed back the first part of gw_MySQLWrite_backend so that it is protected by dcb->authlock which must wait until authentication phase is complete. If authentication fails, the error is handled before next query starts its execution.