Clean the file ownership/mode modifier up a bit

It should be noted that the changes still depend on using reflection
to reach the wanted method. It might be worth switching over to other
implementations later on.