Fix an unused variable warning for non-diagnostic builds.