Bug 863066: Check for error in confirm task

In confirm_user task, add a check that we got a user_data object,
but it showed an error. Log the error and don't try to continue.

Also add a few tests for this task, which didn't appear to have any
tests previously.