Constraining Representations Yields Models That Know What They Don't Know