Restore support for DEX on FAT.

The recent change to mmap(read-write)+mprotect(read-only) doesn't seem
to work on FAT filesystems like /sdcard.  This caused problems for the
code that opens Zip files and the code that opens DEX files.

This change splits the "map file" function into "read only" and
"writable read only" versions, using the former for Zip and the latter
for DEX.  Further, failure to mprotect(read-only) is now considered a
soft failure and only causes a warning.

The only apps that will be affected by this are those using /sdcard to
hold optimized DEX data for "plugin" APKs.

Also: moved the non-HAVE_POSIX_FILEMAP implementation of file mapping
into a shared function.  (Could probably go away entirely.)

Also: fixed the expected output for test 071.
6 files changed