Prepared for submission to JHEP N = 2 ∗ gauge theory , free fermions on the torus and Painlevé VI