internal: ensure that runaway type-inference doesn't block the main loop
internal: ensure that runaway type-inference doesn't block the main loop

We have a bug where type-checking `per_query_memory_usage` takes a
couple of seconds. It also reveals another bug: our type inference is
not cancellable.

rust-analyzer/rust-analyzer,rust-analyzer/rust-analyzer,rust-analyzer/rust-analyzer,rust-analyzer/rust-analyzer,rust-analyzer/rust-analyzer