Fix permission check on treenode tag removal

This commit replaces the code responsible for deleting tags of treenodes
(like 'ends'). Before it was only tested whether a user is a superuser
or is owner of this tag. It didn't honor group membership. This is
is fixed by using the existing permission checking function
'can_edit_or_fail'. It closes #725.