Set the end of the stack for the main thread
This helps the GC by minimizing the stack area to scan, while at the
same time reducing the chance of false positives when scanning the stack
for managed objects since we know no managed object can live on the
stack above the main function. This improves memory usage for the test
case in #2619 quite much (but that particular bug isn't fixed by this).