Refactor extent writer to take filedescriptor in constructor

Functions which receive an instance of extent writer need to manually
pass fd to ExtentWriter via Init() call, which breaks separation of
concerns. It makes it hard for us to decouple InstallOp execution from
writing of data, as the execution unit must be aware of which fd to pass
to extent writer. In addition, many extents writer, such as snapshot
extent writer, simply ignores the fd parameter, which is a indication of
poor code structure.

To address the above issue, we pass FileDescriptorPtr via constructor if
needed. This way, whoever is "executing" InstallOps don't need to care
about where the output data is going, and whoever's writing the data
would be responsible for initializing an ExtentWriter.

Test: th
Change-Id: I6d1eabde085eefd55da9ecc0352d4a16ae458698
diff --git a/payload_consumer/bzip_extent_writer.cc b/payload_consumer/bzip_extent_writer.cc
index 0c25c71..26fdc5f 100644
--- a/payload_consumer/bzip_extent_writer.cc
+++ b/payload_consumer/bzip_extent_writer.cc
@@ -29,8 +29,7 @@
   TEST_AND_RETURN(input_buffer_.empty());
 }
 
-bool BzipExtentWriter::Init(FileDescriptorPtr fd,
-                            const RepeatedPtrField<Extent>& extents,
+bool BzipExtentWriter::Init(const RepeatedPtrField<Extent>& extents,
                             uint32_t block_size) {
   // Init bzip2 stream
   int rc = BZ2_bzDecompressInit(&stream_,
@@ -39,7 +38,7 @@
 
   TEST_AND_RETURN_FALSE(rc == BZ_OK);
 
-  return next_->Init(fd, extents, block_size);
+  return next_->Init(extents, block_size);
 }
 
 bool BzipExtentWriter::Write(const void* bytes, size_t count) {