Issue #1362260 by jaanhoinatski: Fixed user account deletion potentially causing out of bounds PDO error when decrementing flag counts.