Original PR: https://github.com/turt2live/matrix-media-repo/pull/364 Functionality: * [x] `POST /_matrix/media/v1/create` * [x] Per-user quotas * [x] Concurrency limit * [x] Actually check `media` table for duplicate media IDs during generation (and un-reserve on error) * [x] Claim the ID (and un-reserve on upload) * [x] Download/thumbnail timeouts * [x] ~~Clean up dead records via background task~~