A former prime minister of Mali has been charged with “undermining the credibility of the state” following a social media post about his visits to political prisoners, according to a prosecutor.