ugtrain,discovery: sleep 1 sec unless FIFO input

Especially, in stages 1, 2, 3 and 4 there is an infinite loop
without a sleep causing a CPU core to reach 100%. Use a sleep
unless input on the input FIFO to fix this.

In the main loop of ugtrain we already react on user input but
there it also makes sense to react on the input FIFO. So do it
and use a second file descriptor as argument. If it isn't needed,
use -1. We don't use va_list to keep this inline.
linuxhooking: introduce GTK support

With the configure option --enable-gtk it is possible to compile
libmemdisc/hack in a way that they hook on g_malloc(). This
function is used all over the place in GTK/Gnome applications and
doesn't call malloc() internally. So it has to be hooked separately.
libmemdisc: add debug option to flush output FIFO

We need a method to test if the caching of the output causes an
issue. Especially small test applications only produce small output
which never gets flushed otherwise. The next step would be
implementing a timed flush task.
libmemdisc: flush the output FIFO every second

We use SIGALRM to trigger the flush of the output FIFO every
second. Hopefully the game doesn't use SIGALRM! Unfortunately,
forking a flush worker doesn't work as it must be the same process
doing the flush.
linuxhooking: extend the GTK support

There are much more functions to hook than just g_malloc():
g_malloc0(), g_malloc_n(), g_malloc0_n(), g_free(),
g_slice_alloc(), g_slice_alloc0() and g_slice_free1().
So hook them all!