Add extra checks for odd-length EC curve lists.

Odd-length lists should be rejected everywhere upon parsing. Nevertheless,
be extra careful and add guards against off-by-one reads.

Also, drive-by replace inexplicable double-negation with an explicit comparison.

Reviewed-by: Matt Caswell <matt@openssl.org>
Clarify the return values for SSL_get_shared_curve.

Reviewed-by: Matt Caswell <matt@openssl.org>
(cherry picked from commit 376e2ca3e3525290619602dc6013c97c9653c037)