This patch does the following:
- Add two comments warning about opportunities for deadlocks
- Shorten the duration for which the `LABELED_METRICS_TO_IDS` read lock
is held, by moving the `map` variable into a smaller scope. This should
fix the deadlock.
- Fix the label string lookup by making it so that the `id` variable is no
longer shadowed by the lambda argument
- Remove an unnecessary `clone()` call for the label string
- Allow most profile marker tests to run on artifact builds,
except for event and object metrics which aren't supported.
- Add a test specifically to exercise the deadlocking code under IPC.
Differential Revision: https://phabricator.services.mozilla.com/D248705