Terminate X server after timeout and restore crash test handler
After Xorg timeout, we can receive SIGUSR1 from two sources:
- Xorg if it managed to start
- User trying to initiate the crash report test
To make the first case predictable, terminate Xorg if it times out. It will
still send SIGUSR1, because SIGTERM is handled later. However, this
guarantees that there will be no more than one SIGUSR1 from Xorg.
With this fact ensured, reinstate the normal signal handler after first such
signal is received. Any further SIGUSR1 can be sent only by user trying to
test crash reporting.
An user sending this signal before a timed-out Xorg starts is not probable,
but still technically possible. That particular corner case remains buggy:
If that happens, the first signal (from user) will be "eaten" and appear to be
ignored, while the second one (from Xorg) will run a crash report test, but
without switching back to tty1, it might not be visible because Xorg switches
to tty6. This is mainly of interest to QE (RTT).
Related: rhbz#1918702
(cherry picked from commit 2a7970f01f1fe59085fa33f005f84e57fe0e0c9d)