rls: Fix memory leak with duplicate entries in lists

- When duplicate detection is requested, free the string and container
- When duplicate detection is not requested, insert the duplicate anyway