Timed out agent/capsule tasks are not cancelled
Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1284494
Description of problem:
Currently when a client times out because it is down or has taken too long the task is not cancelled and a user may reattempt the same action. Whenever the agent does come online it will still pick up the timed-out tasks and process multiple tasks unexpectedly.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. Register a client with katello-agent installed
2. Make sure goferd is shut down on the client
3. Dispatch a package install or errata apply action
4. Wait for it to timeout
5. Start goferd
Client picks up timedout task
Client does not pick up any tasks, as the task is cancelled.