ThreadedFeatureInputStream deadlock fix

This pull request contains a re-implemented ThreadedFeatureinputStream using blocking queues as the only synchronization method. Existing implementation results in a deadlock in some obscure corner cases.