Fix mpi_leave_pinned and a double free