client: added fallback for os.getlogin()

In short, os.getlogin() doesn't work for all terminals (https://bugs.gentoo.org/show_bug.cgi?id=4647)