Add GetOrRegister method for threadsafe metric registration

Advantages over existing metric creation and registration:

* A single statement creates and registers a metric.
* Unused metrics will now be a compiler error (previously all metrics
  would be "used" at least once when registering them).
* The only threadsafe way to dynamically get-or-create metrics without
  wrapping the existing interface.
* Able to get/create metrics locally instead using global variables.