Memory management fixes in CUDA version of LINCS