dataman: Prevent database corruption
dataman: Prevent database corruption

The size in g_per_item_size[item] is the real struct size
+ DM_SECTOR_HDR_SIZE bytes of header and the backend functions were
not taking in care it. So a call to dm_write() with more bytes than
the real struct is allowed, causing corruption in the header of the
next item.

Kudos to jeonghwan-lee for finding it. https://github.com/PX4/Firmware/issues/7927

mje-nz/PX4-Firmware,dagar/Firmware,mcgill-robotics/Firmware,mcgill-robotics/Firmware,mcgill-robotics/Firmware,PX4/Firmware,acfloria/Firmware,mje-nz/PX4-Firmware,jlecoeur/Firmware,PX4/Firmware,jlecoeur/Firmware,krbeverx/Firmware,PX4/Firmware,Aerotenna/Firmware,Aerotenna/Firmware,krbeverx/Firmware,mje-nz/PX4-Firmware,dagar/Firmware,jlecoeur/Firmware,PX4/Firmware,krbeverx/Firmware,acfloria/Firmware,mcgill-robotics/Firmware,mcgill-robotics/Firmware,jlecoeur/Firmware,PX4/Firmware,Aerotenna/Firmware,PX4/Firmware,dagar/Firmware,jlecoeur/Firmware,acfloria/Firmware,dagar/Firmware,dagar/Firmware,mje-nz/PX4-Firmware,acfloria/Firmware,acfloria/Firmware,krbeverx/Firmware,jlecoeur/Firmware,jlecoeur/Firmware,mje-nz/PX4-Firmware,dagar/Firmware,acfloria/Firmware,mcgill-robotics/Firmware,dagar/Firmware,krbeverx/Firmware,Aerotenna/Firmware,mje-nz/PX4-Firmware,acfloria/Firmware,mje-nz/PX4-Firmware,mcgill-robotics/Firmware,krbeverx/Firmware,Aerotenna/Firmware,krbeverx/Firmware,Aerotenna/Firmware,Aerotenna/Firmware,jlecoeur/Firmware,PX4/Firmware