Improve logging during task-db manipulation.
Improve bitbucket error message.

.json is a bound method.  Calling it is not safe during error handling.
Typofix.
Check specifically for pending and waiting tasks.
Only remove existing uuids if they are found.
Log a little more here.