Use try-with-resources with AutoCloseable resources that were not already using it