cuda-memcheck is not detecting any issues in your code, but crashes instead.
Try to install the latest nightly binary, as recently an invalid handle destruction was fixed (which seems to cause this error).