Support chroot jails without /proc and utmp

Fallback to constant "app" as username in case getlogin() and/or
getpwuid(getuid()) fails.