utests: Refactored test class to make room for related test
Avoid errors about signal handlers when running Robot on thread.

Python doesn't allow non-main threads to register signal handlers.
Robot already ignored errors registering handlers for SIGINT and
SIGTERM if not run on the main thread. When registering the old
handlers back after execution, these errors were shown on the console.

This is fixed by checking are we on the main thread both before
registering our own handlers before execution and also when resetting
old handlers afterwards. Fixes #1848.