Hours after struggle with police, man dies while in custody