Fix some unload issues in CurlFile

cherry-picked from https://github.com/plexinc/plex-home-theater-public/commit/418f5dc4a