Clean up signal sending code as there is too much duplication.

Signed-off-by: Philippe De Swert <philippe.deswert@jollamobile.com>