Eliminate race in thrust::system::cuda::detail::merge_n

Fixes #329
Merge pull request #330 from jaredhoberock/merge

Eliminate race in thrust::system::cuda::detail::merge_n