Fix two minor bugs in producer.go

 - Remove a second superfluous call to bp.flush when bp.flushNow is
   triggered.
 - Release delivery lock after use instead of deferring until end of
   function.

Regarding the second: a deferred call is deferred until the end of the function, not the end of the scope, and it appears the delivery lock can be released after the delete instead of later at the end of the function.