Bug fix: Fix X pixmap leakage in shadow_paint

- Fix X pixmap leakage in shadow_paint.

- Add the skeleton of a X resource leakage checker.