Added nvs_write(). This shares a lot of code in common with nvs_read();