Moved check_perms() into rsync.fns and tweaked how it is called.