Fix for sync teams listing in form (#1660)

We were filtering on the wrong field (team_member.id instead of
team_member.team_id).  The test didn't catch this because when we
created a team, we would also create a team member, so they actually
have the exact same ids.

I wish I could think of a general way to avoid these issues, but I
couldn't.  It would be nice if we could set the sqlite rowids
counter to different values for each table, but I don't think there's
a way to do that other than inserting a value into the DB and deleting
it.