Implement BufWriter::into_slice

As the comment explains, this can be useful when getting the back the
original slice via an additional scope is not practical.