Adds a new numeric -rpcwaittimeout that can be used to limit the
time we spend waiting on the RPC server to appear. This is used by
downstream projects to provide a bit of slack when bitcoinds RPC
interface is not available right away.
This makes the -rpcwait argument more useful, since we can now limit
how long we'll ultimately wait, before potentially giving up and reporting
an error to the caller. It was discussed in the context of the BTCPayServer
wanting to have c-lightning wait for the RPC interface to become available
but still have the option of giving up eventually (4355).
I checked with laanwj whether this is already possible (comment), and
whether this would be a welcome change. Initially I intended to repurpose
the (optional) argument to -rpcwait, however I decided against it since it
would potentially break existing configurations, using things like rpcwait=1,
or rpcwait=true (the former would have an unintended short timeout, when
old behavior was to wait indefinitely).
~Due to its simplicity I didn't implement a test for it yet, but if that's desired I can provide one.~ Test was added during reviews.