What treaty ended the war in which the Battle of Vác was fought?