cluster: improve topic auto-creation
cluster: improve topic auto-creation

The tests added with d6255c51b7 would sometimes fail, when for one
reason or another the test cluster would take longer to set up the new
topic than Cluster._create_topic was willing to wait.

We had to give up after some retries, because we didn't try to
distinguish between cluster settings where auto-create was enabled or
disabled.  This commit adds that ability, by letting _create_topic
inspect the error value in the metadata response.

If the error is a LeaderNotAvailable, that means the cluster
is actually busy setting up our new topic, so we know it may be worth
waiting a bit longer than the fixed 5 retries we had before.

Signed-off-by: Yung-Chin Oei <e4c1ab9da74060df152545062ee274845648ed6c@yungchin.nl>

yungchin/pykafka,benauthor/pykafka,wikimedia/operations-debs-python-pykafka,wikimedia/operations-debs-python-pykafka,thedrow/samsa,benauthor/pykafka,benauthor/pykafka,thedrow/samsa,wikimedia/operations-debs-python-pykafka,yungchin/pykafka,thedrow/samsa