Fix sendfile issue in portable mode.