Outgoing president decided to spare 37 condemned prisoners from the death chamber – but not three others