ugtrain,system: Introduce pid_is_running() function

In ugtrain there is only a single process we really have to care
for and that is the game process. If we have no orphans, then we can
check if it is running with non-hanging wait (waitpid() option
WNOHANG). We use it now if the ptrace()-based memory attaching fails
or if all configs are disabled where we don't attach memory.
This helps us returning in time, returning the correct value upon
game exit and not bugging the user with a ptrace attach error message.

But in order to check if the game process is really running including
orphans, we check PID and process name in /proc directly. We open the
directory /proc/<pid>, read /proc/<pid>/exe and /proc/<pid>/status
for that. Sed extracts the state for us. This is faster and more
flexible than ps-grep magic. We handle zombies as if the process is
not running.