qi.application: Sets and removes signal handlers during 'run' lifetime. #46111
qi.application: Sets and removes signal handlers during 'run' lifetime. #46111

There was a possible crash on application exit, because a callback that
occurred during the process exit tried to execute code using a program that
could be already closed.

Before this fix, handlers were removed during the process exit, causing a crash
when they were called outside of the library's lifetime.

The solution implemented by this fix is to manage handlers only in the run, to
make sure that every handler is removed before the program exits.  With this
fix, it's impossible that a handler still tries to access a program that has
already been closed.

Change-Id: If5466c73c201c08fccb246b510c0e92b5415d03f
Reviewed-on: http://gerrit2.aldebaran.lan/977
Reviewed-by: vincent.palancher <f8ff75e1c61314c499fafa8de0d9e004e87e66b0@softbankrobotics.com>
Reviewed-by: jmonnon <8898eaf233516e520f996a244ca8a12d20f948b1@aldebaran.com>
Tested-by: vincent.lartaud <c999359f64a147c2051744ea5bb23768baf6e9da@external.softbankrobotics.com>

aldebaran/libqi,aldebaran/libqi,aldebaran/libqi