tpm2_nvwrite: fix offset for writing
tpm2_nvwrite: fix offset for writing

The tpm2_nvwrite command calls:
Tss2_Sys_NV_Write()
Which can write at most MAX_NV_BUFFER_SIZE(1024) bytes. Thus,
when writing larger values to the nvindex, it makes multiple
calls to Tss2_Sys_NV_Write() updating the write offset along
the way.

However, each loop invocation was resetting offset, so the data
would just keep getting clobbered.

The tests currently write smaller values, and thus never hit this
issue.

Fix this by not resetting offset inside the loop.

Fix for nv writes the first 1024 bytes and repeats

01org/tpm2.0-tools,martinezjavier/tpm2-tools,01org/tpm2.0-tools,martinezjavier/tpm2-tools,martinezjavier/tpm2-tools,martinezjavier/tpm2-tools,01org/tpm2.0-tools