[Updated] Implementation of blocking close method #4180

Blocks until all bulk requests have completed.  

Updated based on feedback
Updated formatting

This fixes #4158