move fchmodat to shared code
move fchownat to shared code
move *at definitions to common ffifunctions
save local copy of pipe