Fix for the structure.delete user function for molecule metadata once no more data exists.
This relates to 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.
The metadata, when it exists, is now deleted for the molecule once no more data is present.