Fix incorrect kernel thread detection