Fix library restore failing on some windows installs

Fix the restore database operation failing on windows installs with long
usernames (this would cause the path to the temporary folder used to
restore the database to become too long).