producer: wrap leader updates in a circuit-breaker

Otherwise a partition being entirely gone can slow things right down, since
we'll do a complete metadata refresh on every single message.
DRY up the closure
move writer-related utils to separate file
Merge pull request #218 from Shopify/leader-breaker

Leader breaker
Merge branch 'their/master' into feature/writer-ng