Fix length of DBs with unaligned size

Signed-off-by: Michael Buesch <m@bues.ch>