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

os.getlogin() may fail in some situations. It fails for me in guake terminal and after launch from ALT-F2 launcher but works fine in gnome terminal. 
pwd is correct way to get the login name of the process’s real user id. Also with some fallback to getpass for none Unix system.