Fixed Sockets

With a hodgepodge of ifdefs emulating read/write/puts/gets with send and recv.
osf handles are still used, only to store the original socket.