made SGScript system (its memory allocation) to be thread-safe
- TODO refactor old allocator code into something useful