rgw: refactor D3nDataCache::d3n_io_write to avoid resource leaks
1. D3nChunkDataInfo was allocated at the beginning of the function on
the heap, and was not freed in case of errors. This memory allocation
has been moved to where it is being utilised.
2. cache_file file descriptor was not closed if the write to the file
failed. To avoid such issues, cache_file is declared as a unique_ptr
with a custom deleter that closes the descriptor when the ptr goes
out of scope.