Remove History::optimizeHistory() function

It is no longer needed, this function was little confusing
as it actually only executed VACUUM.
Instead, execute VACUUM after clearing all history in
History::clearHistory()