Bug fix. Properly set up thread stack and stack pointer.
Add MAP_STACK flag support to target_mmap().