Move opencv stream closing function to process_stream