Security fixes/failsafe

Skip uid check on Windows (getuid function is not defined on Windows)
and switching to UID instead of file owner