Move AST nodes compilation to main thread to avoid node state contentions

It is address to node state contentions between worker thread and main thread.