Fix POOL-281
Fix a potential infinite loop in the underlying Deque implementation.
Use solution from http://gee.cs.oswego.edu/cgi-bin/viewcvs.cgi/jsr166/src/jdk7/java/util/concurrent/LinkedBlockingDeque.java?revision=1.1&view=markup which is licensed to the public domain.

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/pool/trunk@1643809 13f79535-47bb-0310-9956-ffa450edef68