Rework getent test to work with set -e