LUCENE-5038: Fix test to reliably work with all codecs / posting formats

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1493022 13f79535-47bb-0310-9956-ffa450edef68
Refactor DocumentsWriterPerThread to not hold refreneced to IndexWriter

This patch simplifies locking as well as code in DWPT and friends... more to come :)
revert BytesRefHash
more refactorings
more cleanupse
cleantup dwpt