Consolidate BSD and SYSV defines to UNIX

Mainly affects permissions code