fix(replace_using_ctx): fix inconsistent cache bug in replace_using_ctx, and add tests that expose the problem

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
fix(type_checker): fix inconsistent cache bug in type_checker, add tests that expose the problem

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
fix(light_checker): fix inconsistent cache bug in light_checker, add tests that expose the problem

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