replace os.getlogin() with pwd to get login name

os.getlogin() may fail in some situations (fails for me in guake
terminal). pwd is correct way to get the login name of the process’s
real user id.