Portfolio optimization of credit risky bonds: a semi-Markov process approach