utils: fix another possible leak with private S3 backends using mediaproxy