Bohr–van Leeuwen theorem and the thermal Casimir effect for conductors