Magnus Gustav von Grotenhielm — military officer