type: memoize key_attributes for types.
The key_attributes have about a 0.05 percent miss rate on the cache, and the
value is static for the life of the type, so we can avoid substantial numbers
of object allocations.
Signed-off-by: Daniel Pittman <daniel@puppetlabs.com>