Undertrial dies in custody