tpm2_nvdefine: set the default size from getcap when the size not specified
tpm2_nvdefine: set the default size from getcap when the size not specified

https://github.com/tpm2-software/tpm2-tools/issues/2171
The size of data area currently defaults to 2048 which causes the 0x2d5 error
returned on some machines which don't have 2048 sizes.
$sudo tpm2_nvdefine
WARNING:esys:src/tss2-esys/api/Esys_NV_DefineSpace.c:333:Esys_NV_DefineSpace_Finish() Received TPM Error
ERROR:esys:src/tss2-esys/api/Esys_NV_DefineSpace.c:122:Esys_NV_DefineSpace() Esys Finish ErrorCode (0x000002d5)
ERROR: Failed to define NV area at index 0x1000000
ERROR: Esys_NV_DefineSpace(0x2D5) - tpm:parameter(2):structure is the wrong size
ERROR: Unable to run tpm2_nvdefine

Add helper function to get actual value(TPM2_PT_NV_INDEX_MAX) by tpm2_getcap
to replace the default TPM2_MAX_NV_BUFFER_SIZE(2048).

Signed-off-by: Ivan Hu <dbc3875d71b74ccd819adf39c49a56c1b89c77fb@canonical.com>

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