Fixing resource leaks found by StrictMode