Use patched version of ReferenceManager to prevent infinite loop in RefrenceManager#accquire()

Some users on the mailinglist reported possible infinite loops while acquiring a new searcher. Yet the version this is reported are 0.90.7 but this seems like a general problem addressed in LUCENE-5436. I just committed a fix for the infinite loop such that it throws an IllegalStateException and this PR ports the fix from Lucene to Elasticsearch as a X class.