TDBStore: pad record header to whole program size before storing it
TDBStore: pad record header to whole program size before storing it

Previously, when writing a record header into a TDBStore, we
took the pointer to the record_header_t variable as the input,
but used a program-aligned chunk size which is larger.
As a result, garbage from the stack memory gets written.

This commit fixes that by buffering the record header.

Co-authored-by: Seppo Takalo <a79cb1c919d7203cb1925e0654c27476c1374442@arm.com>

mbedmicro/mbed,mbedmicro/mbed,mbedmicro/mbed,mbedmicro/mbed,mbedmicro/mbed