perf(kernel/type_checker): improve infer_lambda performance

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
perf(kernel/expr): use thread local deletion buffer

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
fix(kernel/replace): make sure 'replace' is reentrant

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>