Fixed various kqueue issues. Sending large files on both Linux and BSD systems now works properly.