Fixed a few bugs that prevented some threads from being awoken when we called minisocket_close()