Fix memory leak introduced by _set_priv() crash fix. #3723

Always free the copied user and file-owner gid lists before copying a
new list from passwd_cache.