[Server] Don't use deprecated QSet methods and minor code improvements
Summary:
Drop one usage of QSet::fromList(), and use QList::removeDuplicates()
instead, assuming the conversion for QList to QSet was to remove
duplicates.
Return early if nameValue is empty, this also guards against accesing
an out of bounds index.
Use QList::at() instead of [], to prevent detaching.
Test Plan: using sasl still works
Reviewers: Konversation, psn, hein, mlaurent
Reviewed By: Konversation, psn
Differential Revision: https://phabricator.kde.org/D27359