[cmake] fixes weird mpi behaviour in tests