Replace all calls to os.getlogin() causing "Invalid argument"

- But only when there's not a terminal, such as w/ Jenkins