Java API: Make sure afterBulk is always called in BulkProcessor

Also strenghtened BulkProcessorTests by adding randomizations to existing tests and new tests for concurrent requests and expcetions

Closes #5038