model: factorize `select_most_specific` from `lookup_*_definitions`

Signed-off-by: Jean Privat <jean@pryen.org>
model: select_most_specific behave correctly when given comparable propdefs

Keep all occurences of comparable but distinct propdefs.
This case should not occurs in sane usage of the function.
But having a good behavior is good nevertheless.

Reported-by: Lucas Bajolet <lucas.bajolet@hotmail.com
Signed-off-by: Jean Privat <jean@pryen.org>