Fix issue where os x reported wrong bytes sent and EOF on success