Fix for incorrect defines of readsocket/writesocket (with thanks to Sébastien Côté)