Avoid shutdown() on shared sockets (fixes #213)

Close the mysql socket before calling mysql_close(). mysql_close() calls
shutdown() on the attached socket. In a situation involving fork() and copies
of an object spanning multiple interpreter instances this will result in the
first instance to GC breaking all other instances sharing the socket.

dylanahsmith notes that we can avoid this by simply closing the socket before
entering mysql_close(), preventing the shutdown() from having any impact on the
shared socket state.