Fixed bug in the batch writer close method.