Add LocalVar<T> class

This allows for the type-safe handling of thread-local and shared
variable accesses. The following changes support this type safety:

* Add LiteralReadInstr<T*> specialization for pointers as uintptr_t
* Create type-strong return type for Recorder::instr() write events
* Allow intermixing of ReadInstr<T> pointers as operands in binary
  operators.