Anton Graf von Arco auf Valley, Leutnant