Man in prison for 38 years for murder has conviction quashed