Implement HistoryHGL#cleanup_histories