Improved terminfo parser (#51198)
This bundles up the following changes:
- Rejiged TermInfo struct
- Read the extended terminfo table using the same method as the
non-extended table
- Use signed integer types for most numeric values, as per term(5)
- More robust get(::TermInfo, ...) methods
- Better match the terminfo(5) "Fetching Compiled Descriptions" behaviour