document predicate signature in restrictCreationByEmailDomain
Use object equality for closing connections for tokens.

Fixes #1540.