fix not closing fd for multipart upload