avformat/hlsenc: improve hls encrypt get key file operation