Update version selection logic for USES= lua
Per discussion on D14709, this patch implements Antoine's suggested "closest
version" logic in place of the previous "highest version" when the default
version is not in the range allowed by the port.
Submitted by: Andrew Gierth <andrew_tao173.riddles.org.uk>
Differential Revision: https://reviews.freebsd.org/D24492