Specs and refactor of #444 preventing dangling connections

Spec added based on https://github.com/brianmario/mysql2/pull/444#issuecomment-28494184

Minor refactor and function name changes.