The Scottish Prison Service has admitted that the death of a man in custody was unlawful - 10 years on from the fatality.