The bail are exonerated by the defendant's death, imprisonment in a penitentiary, or legal discharge from the obligation to be amenable to the process.