Fixed a crash when the AI gets a treasury destroyed and tries to rebuild it within the same turn

To reproduce it easily, the easiest is to disable the cooldown for AI when checking for treasuries. And attack it.