Fix stdin fake mremap creating null bytes on osx, patch courtesy of John Boyle.