Fix writing entries > 2G erroring with POSIX error EINVAL (fix #39)