Bayley, James, 1783-, army officer in India