Only build base thread support with GMX_THREAD_MPI=OFF.

Restore the old behavior of only building the basic threading primitives
from thread_mpi if the MPI parts are not needed.

Change-Id: I0f0f43e86da642c4645fd7ac3c4796098cf9cd5e