A man suspected of carrying out one of the worst mass shootings in recent German history was found dead in his cell after an apparent suicide.