BUG: Fix custom UPF compensation charge
Fix the computation of the compensation charge energy based on custom UPF pseudopotentials with non-uniform grids, which was pointed out and discussed in #411.
Additionally, tweak some parsing and assertions to allow reading of the UPF files based on the latest Quantum Espresso 6.8.