Made a few changes to sendfile functions, fixing sendfile on OS X and (hopefully) BSD. Fixed issue #43.