Fixing error-case memory leaks in uid/gid lookups