Fixed flag deletion when user is deleted.

This patch contains:
- Fixed ID call.
- Added tests for flag deletion when user is deleted.
There is no such thing? 

Needs to be something like $this->assertEqual(1, count($flags_before)). Or do a count query, by adding a count() after the condition(), then execute() already returns the count and not an array with the ID's.