[PATCH v2 2/3] tpm: Convert sandbox-focussed tests to C