pmd: fix #1131 CloseResource should complain if code betwen declaration of resource and try