Comparative study of InN growth on Ga- and N-polarity GaN templates by molecular-beam epitaxy