tests: fix for empty /etc/passwd or /etc/group.

It turns out some Android devices have an empty /etc/passwd and/or
/etc/group, which was defeating the previous workaround. Switch to
testing the intention more directly: we'll try the file in /etc, and if
that didn't work, we'll assume we need a workaround.
2 files changed