Refs #8913 Move history creation to be conditional.

We should only create a history record if we're tracking it as we only discard it later.