This fixes bug #22861 (https://gna.org/bugs/?22861), the chain IDs in the structure.write_pdb user
function PDB files are incorrect after calling structure.delete.
To handle this consistently, the internal structural object ModelContainer.mol_loop() generator
method has been created. This loops over the molecules, yielding those that are not empty. The
MolContainer.is_empty() method has been fixed by not checking for the molecule name, as that remains
after the structure.delete user function call while all other information has been removed. And
finally the write_pdb() structural object method has been modified to use the mol_loop() method
rather than performing the loop itself.