Added repair script to upgrade the legacy home storage ids

:construction: 

I'm tired of these legacy storage id issues when people move their homes, so here is the repair script.
Fixes #6493 

I've tested with MySQL:
- [x] correctly migrates legacy storage ids to home:: based ids
- [x] doesn't migrate existing home:: other storages
- [x] doesn't migrate "local::/path/to/datadir/" which I still wonder why it exists, some kind of root storage?

This needs to be tested on all DBs.

TODO:
- [ ] Test on more DBs
- [x] Add unit tests containing a mix of legacy storage ids, home storage ids and external storage ids

@DeepDiver1975 @icewind1991 @karlitschek 

It turns out that `getNumericStorageId()` returns a string with the numeric id.
If the storage doesn't exist it returns null.

Ah, I see your point. I should cast this afterwards.