Fix IRCSocketHandler to work from Jenkins

When Jenkins runs a scap job there is no controlling tty which causes
os.getlogin() to fail with "OSError: [Errno 22] Invalid argument". Check
for this exception and fall back to using the effective uid's username
instead.

Bug: 63746
Change-Id: I2ab9498309e3b31867af3c8405aa7a7a8954d541