Make cache-recycling operations thread-safe.

When using DFS-query-then-fetch, some facet data-structures are acquired and
released on a different thread, which is something that is not supported by
the (soft) thread-local cache recycler.

On 1.x, this limitation has been removed, and all recyclers actually support
acquisitions and relases on different threads. This commit makes sure it also
works on 0.90 by making the stack that is used to store pending objects
synchronized. The performance impact of these synchronized blocks is expected
to be very low as there would be very little contention. By the way calls to
acquire/release are synchronized on the default cache recycler on 1.x.

Close #4754
[Test] IndicesLifecycleListenerTests - added busy waiting for expected results (and improved error message)

The test currently uses ensureGreen to guaranty all shard allocations has happened. This only guaranties it from the cluster perspective and in some cases the nodes are not fast enough to implement the changes (which is what the test is about).
PUT /_aliases should accept a numeric routing value

Also added REST tests for setting index/search/routing
via the PUT /_aliases endpoint

Fixes #5465