Java API: Make sure afterBulk is always called in BulkProcessor

Java API: Make sure afterBulk is always called in BulkProcessor.

Also strenghtened BulkProcessorTests by adding randomizations to existing tests and new tests for concurrent request.

Closes #5038
I might be wrong...but `InterruptedException` can only be thrown in `semaphore.acquire`, which is before `beforeBulk` can get called. IMO we should just remove this line, that's why I added the comment...