nvenc: Don't leak CUDA device memory

Allocated device memory should be freed with cuMemFree
10 jobs for nvenc-cleanup-resource in 35 minutes and 31 seconds (queued for 4 seconds)