Fixed encryption migration when entry is missing in DB

When resetting the DB and some users still have encrypted files, the
migration state isn't read properly becaue the migration entries are
missing. This causes the wrong file size to be returned.

This fix inserts the missing migration entry when this condition is met.

Fixes #5541

Please review @schiesbn @karlitschek @DeepDiver1975