You need to join the table to itself, with the main thread row in the first side of the join and the post rows in the other side:
select t1.subject
from mytable t1
join mytable t2 on t2.thread = t1.id
where t1.thread is null
group by 1
order by count(*) desc
limit 5