Errors in Hellmann-Feynman forces due to occupation-number broadening and how they can be corrected