Refactor and simplify the ECC extension handling. The existing code
effectively built two "static" data structures - instead of doing this,
just use static data structures to start with.

From OpenSSL (part of a larger commit).

ok miod@
Fix regression introduced in revision 1.15 by using strndup() instead of
strdup() to allocated directory list components.

ok jsing@