Mali military junta agrees to release ousted president