Fixed thread id casting to integer on big-endian platforms.