Repaired a subtle bug with writing theory files.

For cases where a type was being written, if there was a bound type
variable which was the same as an outer bound type variable,
the inner bound type variable was not interned in the type map
used by the printer of the theory file.