Sort by release version properly
It should be compared as a version number instead of normal string.
This implementation works with postgresql but not with sqlite and
may not work with other database engine.
JIRA: RHELCMP-3513
Signed-off-by: Haibo Lin <hlin@redhat.com>