Implement Client.WritablePartitions

It returns the list of partition IDs (like normal Client.Partitions) except
limited to those partitions which have leaders that are available and accepting
writes.

Bonus fixes:
- permit setting the error field in MetadataResponse.AddTopicPartition
- add "closed" check to Replicas and ReplicasInSync
- permit MetadataRetries == 0, which is at least logically coherent (and
  behaves sanely), even if it's not usually useful
Rework Partition interface and usage

- permit Partition() to return an error, since the HashPartitioner can
  theoretically hit errors calculating the hash or materializing the key
- have each partitioner indicate whether it requires consistency or not

A partitioner that requires consistency (primarily the HashPartitioner) is one
for whom "partition not available" means "fail the message" as opposed to "try
some other partition" (which is better behaviour for the RandomPartitioner, for
example). Respect this value in the producer by using Partitions() or
WritablePartitions() depending.