Bug 875369 - Log failed Basket tasks

When a basket task is unable to complete (after exhausting its allowed
retries), log the task name, parameters, and whatever exception made
it fail into a database table where we can look at it later.