A divergence-free semi-implicit finite volume scheme for ideal, viscous, and resistive magnetohydrodynamics