In more recent LensFun versions, LensFun itself sets LF_SEARCH_SORT_AND_UNIQUIFY.  See http://svn.berlios.de/wsvn/lensfun?op=comp&compare[]=/trunk/@331&compare[]=/trunk/@332