src: simplify ECDH::GetCurves()
There is no need to explicitly branch based on num_curves
or on the return value of the second call to EC_get_builtin_curves
. Remove unnecessary branches and replace the loop with a functional transform.
Previously, the last line of the function body was never executed because, in practice, num_curves > 0
.