fix build on BSDs

S_I{R,W,X}{GRP,OTH} are not defined in syscall on dragonfly, freebsd and openbsd.