Use `connection._protocol._ended` state
maintain `connection.state` instead

@mickhansen I believe that problem was occurring because
“protocol_error” is a faulty state, not a valid one.
code coherence
Merge branch 'hotfix/mysql-connection-validate' into production