GEOMESA-453 ClosableIterator flatMap may end prematurely

refactored ciFlatMap method to use an internal tail-recursive helper, and added a test that smashes the stack with the old code.