pthread_self: add support for the main thread