Mauritania releases ex-president from prison