Since we're supposed to call this for each installed path, we only should go
through what we've installed and not what this point to, as it might be
outside our scope or not existent.
To do this, since shutil.chown doesn't expose the follow_symlink that os.chown
has, we can temporarily replace os.chown with a lambda that acutually passes
all the values as we want them, and then restore it to the built-in functions.
Not the nicest way, but fixes the issue without having to reimplement what
shutil does.
Fixes#3914