Simplify code in MinecraftVersionDetector.

Refactored getMinecraftVersion method to be clearer and more readable.

Made sure all of the files are closed when they are no longer used.
There were some corner cases where files wouldn't have been closed if an
exception was to be thrown.

Also changed the code to use `IOUtils.toString` instead of a
hand-written `for` loop to read a file into string.

Signed-off-by: Henry Heikkinen <rce@rce.fi>