logger: do not rely only getlogin(3) telling who ran the command

The getlogin(3) is known not to always work, and when that happens it is
reasonable to try determine user of name by looking process owner and
passwd information.

Reference: http://man7.org/linux/man-pages/man3/getlogin.3.html
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
logger: collapse if clause

An if clause that continues throughout whole function can be shorten to
immediate action, e.g., in this case return; at the spot not at end of
the function.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>