Make cli build on freebsd
system: add IsSafe for freebsd
system: add SafeTemDir for freebsd