linux_clone_thread() and kthread_add() did not call the
PMC_FN_THR_CREATE hook. Their new threads had no hwpmc thread
descriptor. If the process had a sampling PMC, the first switch-in
of such a thread hit KASSERT(pt != NULL) in pmc_process_csw_in().
An unprivileged user could panic an INVARIANTS kernel with
"pmcstat -P" on a threaded Linux program.
Call the hook in both functions, as thread_create() does.
kern_kthread.c did not include opt_hwpmc_hooks.h, so its hwpmc code
never compiled. Include it, and use newtd in kthread_add1().
Remove the exit log call from kthread_exit(), because thread_exit()
already logs the exit.
Reported by: llm-postcr
Fixes: 6161b98c9935 ("hwpmc: Implement per-thread counters for PMC sampling")