storage: commit to database after visiting all files

Signed-off-by: Andreas Fenkart <andreas.fenkart@dev.digitalstrom.org>