Update the mutex-protected variable API
The MPV API only works well with primitive types. It would be nice for it to work with structures, objects and containers. Any solution needs to be as efficient as working with the underlying variable directly. We're only looking for a way to add compile-time checks.