Fix auto-reconnect for the spigotmc plugin.
This fixes the auto-reconnect functionality for the SpigotMC plugin. It adds a check to make sure that the socket is in the 'CONNECTED" state prior to trying to send anything, and tries to reconnect if it isn't. Additionally, a short (0.9s) timeout is added for the socket operations. Unfortunately, the way this check is made is different between Linux and BSD style networking stacks. It's really easy to do on Linux (because the TCP_INFO socket option returns a structure there), but is non-trivial to do from Python on BSD (because on BSD the same socket option takes a pointer to a structure to be filled as an argument, and the return is success or failure). This only implements the Linux method, and additionally adds a check to disable the plugin on non-Linux systems.