Prior to this commit, we emplace type variables into `Index<TypeTag>`
only for translated top-level types. However, we need to be careful to
do this emplacement for nested types as well! This patch ensures we do,
but immediately emplacing the destination variable of a type when we
allocate a variable for it.
This materially improves performance for programs that are
recursion-heavy (as most Roc programs will likely be).
```
$ hyperfine '/tmp/roc-old check examples/cli/cli-platform/Arg.roc' '/tmp/roc-new check examples/cli/cli-platform/Arg.roc' --warmup 10
Benchmark 1: /tmp/roc-old check examples/cli/cli-platform/Arg.roc
Time (mean ± σ): 53.8 ms ± 1.3 ms [User: 87.3 ms, System: 10.8 ms]
Range (min … max): 52.2 ms … 60.4 ms 51 runs
Benchmark 2: /tmp/roc-new check examples/cli/cli-platform/Arg.roc
Time (mean ± σ): 45.0 ms ± 1.6 ms [User: 59.4 ms, System: 11.3 ms]
Range (min … max): 42.6 ms … 49.8 ms 60 runs
Summary
'/tmp/roc-new check examples/cli/cli-platform/Arg.roc' ran
1.20 ± 0.05 times faster than '/tmp/roc-old check examples/cli/cli-platform/Arg.roc'
```
The time spent in `occurs` during checking for `Arg` drops from 50% to 23%.
MacOS SIGUSR1 is signal 30, not 10 as it is on Linux.
At least on MacOS clang, we need the added headers to the c platform's
host to compile correctly.
Previously we only collected type names that appeared on the surface of
a type during alias analysis, but certain types that need to be named
(i.e. recursive types) may be observed only when we actually convert the IR
to the morphic IR. Make sure we collect those appropriately.
This is a cherry pick of the relevant changes in #4121.
We're now reaching the steady state we want to be closert to - when a
type is translated to a variable, emplace the variable we created for it
in the type index, so that types are never converted again!