Rewrote the calculation of the number of DOFs.

It was broken for the combination of PIMD, centroid freezing and ghost
atoms present in the system. This fixes it.
Use the right number of DOFs to estimate pressure
Merge pull request #12 from OndrejMarsalek/n_DOF

Rewrote the calculation of the number of DOFs.