Implement per-pool stats, fix bug GDI+ shutting down too early