Phase transition and optical properties of ultrathin KNbO3 nanowires