system: add IsSafe for freebsd
system: add SafeTempDir for freebsd