[GEO] Fix for ArithmeticException[/ by zero] when parsing a "polygon" with one pair of coordinates

While this commit is primariy a fix for issue/8433 it adds more rigor to ShapeBuilder for parsing against the GeoJSON specification. Specifically, this adds LinearRing and LineString validity checks as defined in http://geojson.org/geojson-spec.html to ensure valid polygons are specified. The benefit of this fix is to provide a gate check at parse time to avoid any further processing if an invalid GeoJSON is provided.  More parse checks like these will be necessary going forward to ensure full compliance with the GeoJSON specification.

Closes #8433
Correcting coordinate checks on LinearRing and LineString, updating test
Adding parse gates for valid GeoJSON coordinates. Includes unit tests.
Updating to throw IllegalArgument exception for null value coordinates. Tests included.
Logging: restrict files loaded as logging configuration based on their suffix

Make sure that files such as logging.yml.rpmnew or logging.yml.bak are not loaded as logging configuration.

Only files that start with the "logging." prefix and end with ".yaml", ".yml", ".json" and ".properties" suffix get loaded.

Closes #7457
[TEST] move LoggingConfigurationTests to common.logging.log4j

Make also LogConfigurator#ALLOWED_SUFFIXES package private so that it can be used in LoggingConfigurationTests, now that it's in the same package as the class that it tests.
Add few randomized aspects to LoggingConfigurationTests.
[DOCS] document that we support loading multiple logging conf files
add more debug logging if recovery thread got iterrupted
[GEO] Add LinearRing and LineString validity checks as defined by http://geojson.org/geojson-spec.html to ensure valid polygons are specified at parse time.

Closes #8433
Fix example in logging daily rotate configuration

PR #8464 come with a bug in the example provided.

First, the current log file is not compressed so it should not end with `.gz`.
Second, conversion pattern was removing all the log content but was printing only the log date.
Then, the current log filename was hardcoded to `elasticsearch` instead of the cluster name.
Fix: If dangling_timeout was set to 0 and auto_import_dangled
was set to yes, dangling indices were deleted by mistake,
because a RemoveDanglingIndices runnable was added
to every dangling indices, without considering the auto_import_dangled
setting.
Internal: IndexService - synchronize close to prevent race condition with shard creation

During node shutdown we have a race condition between processing cluster state updates (creating shards) and closing down the index service. This may cause shards to leak and not be closed properly.

This commit removes the concurrency in shard closing as InternalIndexService.removeShard has been synchronized for a long time now.

On the other hand, the commit restores the parallel shutdown of indices lost in 7e1d8a6ca3b23c07cbaebe72831c7ef4a201bd2b

Closes #8557
[CORE] Free pending search contexts if index is closed

Today we hold on to search context reference if they are not cleaned
up for a while until a reaper thread trashes them if they timed out.
This commit removes all pending contexts once the index is closed to release
resources and filehandles immediatly once the index is closed.
[RECOVERY] Allow to cancle recovery sources when shards are closed

Today recovery sources are not cancled if a shard is closed. The recovery target
is already cancled when shards are closed but we should also cleanup and cancel
the sources side since it holds on to shard locks / references until it's closed.
[TEST] Add search trace logging for debugging
Core: Added query/filter wrapper that builds the actual query to be executed on the last possible moment to aid with index aliases and percolator queries using `now` date expression.

Percolator queries and index alias filters are parsed once and reused as long as they exist on a node. If they contain time based range filters with a `now` expression then the alias filters and percolator queries are going to be incorrect from the moment these are constructed (depending on the date rounding).

 If a range filter or range query is constructed as part of adding a percolator query or a index alias filter then these get wrapped in special query or filter wrappers that defer the resolution of now at last possible moment as apposed during parse time. In the case of the range filter a special Resolvable Filter makes sure that `now` is resolved when the DocIdSet is pulled and in the case of the range query `now` is resolved at query rewrite time. Both occur at the time the range filter or query is used as apposed when the query or filter is constructed during parse time.

Closes #8474
Closes #8534
Test: Fix malformed mapping setting, slipped in from merging a commit from 1.x
Revert "[CORE] Free pending search contexts if index is closed"

This reverts commit edc48f39c5ed80c235442e9f4ba87fe1db3eb0f2.
Revert "[TEST] Add search trace logging for debugging"

This reverts commit a7b2bdca4c8779e1fca6d89db8967233e42136ec.
Tests: Add static index based backcompat tests

This change adds tests against static indexes for previous versions
of elasticsearch. It also adds a python script to
generate the indexes.