Implementation of blocking close method

Blocks until all bulk requests have completed.  This fixes #4158