Fix deleting memberships on workgroup destroy

When a group will be deleted (not marked as deleted), it should remove belonging memberships as well. Also added a migration clean up task to remove all broken memberships.
Just for the record: this should have no problems regarding query length. Postgresql [has an unlimited query length](http://www.postgresql.org/message-id/15706.1044565361@sss.pgh.pa.us) for quite a while now, mysql has [at least a default of 1MB](http://dev.mysql.com/doc/refman/5.6/en/server-system-variables.html#sysvar_max_allowed_packet) which allows for >150k groups (our largest installation has no more than 1000).