Raises error on close if now rows have been added...

Before this if you instantiated an encoder and accidently tried to copy
to a table without adding anything to the encoder it would just throw
the error:

```
NoMethodError: undefined method `write` for nil:NilClass from ...../encoder_for_copy.rb:22:in `close`
```

Now if something happened like:

```ruby
encoder = PgDataEncoder::EncodeForCopy.new(use_tempfile: true)

collection.each do |thing|
  if impossible_thing # this is never true
    encoder.add(thing.id, thing.name, thing.other_thing)
  end
  Thing.pg_copy_from(encoder.get_io, format: :binary, columns: [:id, :name, :other_thing])
```

Instead of throwing a NoMethodError you'll get a more helpful error to
put you on the right track.