pseudofs: Simplify pfs_readdir() and set eofflag
There were two loops, one to skip entries before the requested offset,
and one to populate entries. Merge them and use the return value of
pfs_iterate() to decide whether to set eofflag.
As a side effect, this fixes a small bug: the first loop would decrement
offset to zero, and the second loop would increment it again.
However, offset was used to set d_off, and we should include the
starting offset there.
Add a comment explaining the use of the allproc lock.
Reviewed by: des, kib
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D51462