Fix/task timeout

Fix #13.

The main purpose of these changes is to fix the bug when a task raises a `TimeoutError`. A corollary is that errors are a bit clearer.