Mechanisms of template-assisted selective epitaxy of InAs nanowires on Si