WL-3192 Remove the realm if it is empty

We are considering a realm to be empty if it has no roles nor members and
before saving we should remove any roles which have no permissions set.
Merge pull request #3 from ox-it/WL-3192

WL-3192 Remove the realm if it is empty