fixed last group owner issue and added test
The change prevents a user that is owner of the group to add itself as master - which would imply adding a privilege to delete themselves from the group being the last user on it.
Added a relevant test.
Should fix #1111 (closed)