Fix an error in record_question_visit task when the user is anonymous