Add variable main-thread, fix Bug#32169
* doc/lispref/threads.texi (Basic Thread Functions): Add example,
how to propagate signals to the main thread. Describe variable
`main-thread'. Document optional argument CLEANUP of
`thread-last-error'.
* src/thread.c (Fthread_last_error): Add optional argument
CLEANUP. (Bug#32169)
(main-thread): New defvar.
* test/src/thread-tests.el (thread-last-error): Adapt declaration.
(main-thread): Declare.
(threads-main-thread): New test.
(threads-errors): Extend test.