Seperate freeDeviceMemory from cleanupGPUResource

Update GPURuntime library so that we can free multiple device arrays
and parameters.
Fix bug: generate incorrect loads for multiple arrays in kernel