DRILL-2510: Fix unclosed allocators detected in Java shutdown hook
TestWriteToDisk
- fix warnings, including closing unclosed resources with try-with-resources
TestAllocators
- close unclosed resources
doesn't use try-with-resources because this stresses interleaved allocation
operations that wouldn't necessarily be nested
StackTrace
- created convenience class for tracking stack traces
Drillbit
- used StackTrace to track location of Drillbit starts for shutdown hook
error messages so we can more easily identify errant tests from just the logs
in future
- added an isClosed flag to detect that the Drillbit has already been closed
to avoid complaints about double closures that happen in many tests that
explicitly close their drillbits (the shutdown hook then closes them again,
causing bogus complaints)
- synchronized close()
- made the id generator in the ShutdownThread an AtomicInteger