Improve ForemanTask.poll

Exceptions raised on other threads are not caught by the current thread.
Make the timer thread raise a KeyboardInterrupt on the main thread when
the polling timeout expires, then catch the exception and raise a
TaskTimeout exception instead.

Also polls for the task result of success or error instead of the
pending state that still pending even if the task have failed with an
error.
Merge pull request #1404 from elyezer/improve-foreman-task-polling

Improve ForemanTask.poll