[TECH-SUPPORT] LPS-50111 ImageToolImpl.read() may cause 'Too many open files'

Hi Ray,

Sometimes ImportToolImpl.read() deplates the number of file descriptors. Altought, I haven't been able to go that far in term of reproduction, it's true that ImageIO.createImageInputStream() implicitaly creates hundreds of imageio*.tmp files under $CATALINA_HOME/temp.

What happens is that ImageIO.createImageInputStream() instantiates either a FileCacheImageInputStream or a MemoryCacheImageInputStream, this is decided in InputStreamImageInputStreamSpi.createInputStreamInstance() depending on the value of ImageIO.getUseCache().

Basically FileCacheImageInputStream instances are closed automatically before being garbage collected and when this actually happens temp files are removed too. com.sun.imageio.stream.StreamFinalizer takes care of that, yet in some cases (we have a customer for whom this causes regular outages), between two GC cycles file descriptors may run short.

This fix does tree things:

* ImageInputStream instances are closed immediately, althought the official documentation doesn't use close() at all.
(http://docs.oracle.com/javase/7/docs/technotes/guides/imageio/spec/apps.fm8.html)
* ImageReader objects are disposed too.
* Introduces property "image.use.disk.cache" as a trade-off between I/O and memory footprint

Thanks for reviewing!

Cheers,
László