Fix warning about resource leak (jdk7)