_find_by_unique_key - bugfix
There was a wrong order of the argument binding.
Both the orders of the fields of the unique key: (1)
in the SQL statement and (2) in $dbd->bind_param() were
determined by the simple hash key iteration.
This accidentally worked with some old Perl versions but
with Perl v.5.18 (Ubuntu 14.04 LTS) it is not working anymore.
As a result, during the saving of RichSeq into the BioSQL database
`term` entries were sometimes not found by its unique key.
It led to the automatical creation of duplicated entries in the
`term` table. This, in its turn, lead to a crash later, when
the search by name or ontology_id brought several rows whereas just
one is expected. The unique key of the table:
UNIQUE KEY `name` (`name`,`ontology_id`, `is_obsolete`)
did not prevent the duplications because `is_obsolete` is always
NULL (it seems that this field is itself obsolete) and, since
SQL standard assumes NULL is not equal NULL, the duplications
are "unique" do not violate the constraint.
In order to resolve this issuet the sorting was added so that
the two argument orders were always the same.