Clean up MPIT code. Fix locking issues with some MPI_T calls.