Fixes regression introduced in D8887.
This is a solution for ENG-4926.
When the code gets to run, the outer function generateRandomString may have already returned. This means that size might have been destroyed, and there is an undefined reference. That's why this function generates backupID with length 0 and as an effect causes Argon2 to throw salt too short.
On dev everything worked, everything happens only on prod when code is more optimized.
I also added casting to the correct type.