you need to rollback after an error occurs in commit()

or we will get InvalidRequestError in bgtask's own commit() (in this
case that is)