Fix another unit test memory leak. CID1087949,CID1087950.
Add checks to prevent memcmp(.,.,negative) in tests (CID 1064417)
Only update view of micrdescriptor pos if pos is fetchable.

It's conceivable (but probably impossible given our code) that lseek
could return -1 on an error; when that happens, we don't want off to
become -1.

Fixes CID 1035124.
Avoid warning about impossible check for flags & 0

Fixes CID 743381