Fixes regression introduced in D8887.
This is a solution for: [ENG-4926](https://linear.app/comm/issue/ENG-4926/client-backup-upload-issue).
At the time code gets to run, the outer function `generateRandomString` may have already returned. This means that `size` might have been destroyed, and there is undefined reference. That's why this function generates backup ID with length 0 and as an effect cause `Argon2` to throw `salt too short`.
On dev everything works, this happens only on dev when code is more optimized.
Also added casting to correct type.