posixshm: fix counting of writable mappings
Similar to mmap'ing vnodes, posixshm should count any mapping where maxprot
contains VM_PROT_WRITE (i.e. fd opened r/w with no write-seal applied) as
writable and thus blocking of any write-seal.
The memfd tests have been amended to reflect the fixes here, which notably
includes:
- Fix for error return bug; EPERM is not a documented failure mode for mmap
- Fix rejection of write-seal with active mappings that can be upgraded via mprotect(2).
Reported by: markj
Discussed with: markj, kib