added gettid() for OS X.
added some code to TFileAioWriter for OS X.