At least five people have been killed in a bombing at a mosque in a pro-Taliban seminary in Pakistan, including a cleric who police say was the target.