Application: Fix a race condition in signal handler.

Change-Id: I1247d0d8b5d2ae26241d59bd21981a5432859eb4
Reviewed-on: http://gerrit.aldebaran.lan:8080/11374
Reviewed-by: cgestes <gestes@aldebaran-robotics.com>
Reviewed-by: mnottale <mnottale@aldebaran-robotics.com>
Tested-by: mnottale <mnottale@aldebaran-robotics.com>