Introduce getUploadIDsFromMediaMessageServerDBContents(...) and consume in fetchUploadsForMessage(...) and assignMessageContainerToMedia(...).
Simple refactor to reduce redundant code.
Addresses feedback from @ashoat here: https://phab.comm.dev/D5087#inline-33653