Fixes bug in transaction state wrt indexes

When an index had been added to a transaction, for a particular label and property,
and the store already had a committed index for that particular label but a
different property, and you tried to look up that index, e.g. to examine its state,
then we did not properly filter out the uncommitted index when we applied the
state of the transaction to the lookup results.

This fixes #2279
Make shell bind to correct host.

- RMI is hard-coded to bind to a host specified by a system property, this
  circumvents that by passing in a custom socket factory.
- No fix provided for 1.9, since the host option was introduced in 2.0.
  1.9 users can still specify the host to use by setting the
  java.rmi.server.hostname system property.
- Add remote_shell_host to docs and default config files
Plug a file descriptor leak

Turns out we did not properly close our IndexReaders when the transaction contained relevant changes
and wrapped the lookup iterators (that are resources) in diff-applying iterators (that are not).

This fixes #1799
Shebang lines must have a ! in them.
Merge pull request #2381 from chrisvest/1.9-fix-shell-shebang

1.9 fix shell shebang
Merge pull request #2380 from chrisvest/2.0-file-descriptor-leak

2.0 file descriptor leak
Merge branch '1.9-maint' into 2.0-maint
Merge pull request #2374 from chrisvest/2.0-index-lookup-tx-state

Fixes bug in transaction state wrt indexes
Merge pull request #2373 from jakewins/2.0-shell-host-fix

2.0 shell host fix
Ignores file descriptor test for windows, conceptually doesn't work on that OS