Risk sensitive control of finite state Markov chains in discrete time, with applications to portfolio management