ImgSaver: remove ImgPlus.setSource hack

We were overriding the source of a provided ImgPlus, so that the value
could be read back later as the id. This is backwards.

Instead, if we are given a valid id, we can just use it to initialize a
Writer. If we are provided a null Writer or Writer without attached
Metadata, then we default to the provided ImgPlus's source if it is
valid.

There is no scenario where, if given a String id, we would end up with a
null Writer or Writer with no Metadata, since these objects can be
derived given the ID.

The solution was to split the writeImg methods into a universal entry
point that collects metadata, two intermediaries - one for String paths
and one for Writer paths - that populate the appropriate objects if
able, and a final method to perform the actual output.
ByteArrayHandle: don't null buffer on close

It is common that after writing to a ByteArrayHandle we will want to
obtain the array that was populated. However, if the handle is closed
its buffer was being nulled out. This is unnecessary, as when the handle
is discarded its buffer will be as well.

Similar to the functionality of ByteArrayOutputStream.close
Add ImgSaverTest

Created a test class for ImgSaver. This should help catch issues where
we break writing.