Entanglement entropy of a massive fermion on a torus