feat(util): add primitives for checking the amount of available stack space

Recursive functions that may go very deep should invoke the function check_stack. It throws an exception if the amount of stack space is limited.

The function check_system() is syntax sugar for
    check_interrupted();
    check_stack();

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
test(library/rewriter): add lambda_rewrite tests
fix(library/rewriter): use Abst axiom in lambda_body RW
feat(util/stackinfo): implement get_stack_size (Mac OSX version)