brianmario/mysql2 — pull request #497 by sodabrew (2014-03-21 20:38:45+00:00)
Title: After closing the MySQL fd, set it to -1 to prevent a race condition

This updates a2bcfd6 / #213 / #463.

The MySQL library also calls close() on the fd, so it is possible for another
thread to have a new use for the same fd value. By setting the fd to -1, the
second close() will return EBADF without the risk of closing the wrong file.