New ASN1 external type LONG. This parses an ASN1 INTEGER
and stores the result in a long directly. This handles
negative longs OK and has range checking.
The value ASN1_LONG_UNDEF is used to indicate that the long
should be omitted (for OPTIONAL types). This is set to
0x7fffffff which is well beyond the normal expected range
of this type: it will typically be used for version numbers
where only a small value is used.
Also used the return value 2 from the callbacks to new/free
as a magic value which means that the callback itself will
handle new/free operations and the standard behaviour is
inappropriate.