Pakistan's former Prime Minister Imran Khan attends court