Nissan has confirmed a data breach affecting 21,000 customers following a security incident at its software provider, Red Hat.