When the Ruby interpreter forks after creating a mysql2 instance, each mysql2
object will share a socket and the first object to be garbage collected will
destroy the socket state for the second object. This appears to be the
underlying bug in issue #213.

Because the GC is non-deterministic, sometimes child processes will exit
without calling the GC on copies of the mysql2 client object before ending the
child process. In our tests we force the GC to run, exposing the issue in a
reliable manner.

I work around this issue by preventing the GC from collecting instances in
child processes entirely. This patch causes the GC to only collect mysql2
objects within the same process which spawned them (within the parent). #close
continues to function as it has, in case it is desired to force cleanup of the
socket state.

It would be ideal to have a more granular or configurable interface for cleanup
than mysql_close(), allowing us to perform everything but the call to shutdown().