Add stack guard code to detect infinite recursion. Current limit is 1MB of allocation on stack. This can be revisited in the future but this should be a sane default for most OSes.
Merge commit 'ff6043174f07d5cc1bee4180681197bf4be574e0'