Deterministic signatures

This implements deterministic (RFC6979-based) signatures using libsecp256k1's signing. Note that the test cases here were constructed using an earlier version of this patch (which implemented them on top of OpenSSL), so the deterministism has been consistent.

Earlier version of this message:
The OpenSSL-based deterministic signing implementation is likely very temporary, as we may switch to libsecp256k1 for signing soon (#5220), but it allows testing. The signatures generated by the OpenSSL and libsecp256k1 based implementations should be identical, so the test cases are already useful.

I would prefer not to iterate though all the words of the nonce unnecessarily, even of nothing is changed. It reduces the possibility that part of the nonce is kept in the stack or in registers.

I propose adding:
if (test_case)
  nonce += test_case;