ugtrain: support vanilla glc-capture

With checking the libc __progname variable it is possible to detect
if we are loaded into the game process or glc-capture. This way
we just need to append the library to be preloaded to LD_PRELOAD.
The glc-capture command will append its own libraries to it and
our libs will wait until the process with the correct name is
executed. This also works for other preloader commands which append
to LD_PRELOAD.
ugtrain: fix use_wait for pid_is_running() usage

Always when we use a shell to call the game or if the game call
differs from the process name, we can't use waitpid() to check if
the process is still running. Add this check to fix the issue.