replace getlogin with a safer option

os.getlogin does not work with cron or other headless jobs