Revert "Avoid using pwrite with mmap (or use msync)"

This reverts commit af86d87414dfd70312222d7e6569f431cda106fb.
Revert "Detect endian/bitness correctly on OpenBSD and others"

This reverts commit 34c7f2e3df7637224daa4e8c63ee399b5b8d0d73.