[NEXUS-6015] Try-with-resources only before using kenai config file reader

Signed-off-by: Alin Dreghiciu <adreghiciu@gmail.com>