[web] factor out creation of DeviceKeyUpload
Summary:
we will need to create an object of this type for wallet login too, so moving the common code to a helper
Depends on D10959
Test Plan: successfully logged in to identity service on web, console logged DeviceKeyUpload to make sure it matched the contents in DDB
Reviewers: ashoat, tomek, inka
Reviewed By: tomek
Differential Revision: https://phab.comm.dev/D10960