Nearly 1,000 protesters were arrested in Islamabad after a large rally demanding the release of jailed ex-prime minister Imran Khan.