main: Use only signal-safe functions
Previously signal unsafe functions were used (for example qb_log, exit,
...) which may result in deadlock or incorrect behavior.
Patch tries to solve signal handling in main.c by using using method of
setting variable (signal safe) and handling variable outside of signal
handler in loop function after the poll function returns.
Maximum poll timeout is set to minimum of POLL_TIMEOUT and user
configured timeout, so it is always at maximum POLL_TIMEOUT = 100 ms so
signal handling seems to be responsive enough. Other method may be to
have information fd, but such solution seems to be a bit overkill.
Signed-off-by: Jan Friesse <jfriesse@redhat.com>