Replaced CreateThread with Delphi-specific "thread-safe" BeginThread (avoids random AVs of memory manager since we were not setting IsMultiThread to True).