Imran Khan, the former prime minister of Pakistan, will remain in jail despite being acquitted of unlawful marriage charges.