cwrap: FIX: Reflect changes to main process when syscall is called.

Previous patches fixed only part of the problem.

When syscall is called, function must decide if function was called
from main process or from thread.

Signed-off-by: Robin Hack <hack.robin@gmail.com>