Sonar: Fix missing resource closing