Make CCryptoKeyStore::Unlock check all keys.

CCryptoKeyStore::Unlock has a loop to attempt decrypting each key which
 only executes once, likely due to a simple mistake when the code was
 originally written.

This patch fixes the behavior by making it check all keys. It also adds
 a fatal assertion in the case some decrypt but some do not, since that
 indicates that the wallet is in some kind of really bad state.

This may make unlocking noticeably slower on wallets with many keys.
[Qt] Payment request expiration bug fix

Currently a payment request is only checked for expiration upon receipt.
It should be checked again immediately before sending coins to prevent
the user from paying to an expired invoice which would then require a
customer service interaction.
Add SCRIPT_VERIFY_CLEANSTACK script verification flag

Causes VerifyScript() to fail if scriptPubKey/redeemScript execution
leaves more than a single stack item. This is a generic malleability fix
that can be used with all scriptPubKeys.
Split up EvalScript into EvalScriptState::Start and ::Step, so single-stepping can be done
Discourage fee sniping with nLockTime
Reject transactions with excessive numbers of sigops
Refactor message handling for lower latency

- ThreadMessageHandler woken up by events that require it
- TRY_LOCKs replaced with LOCKs to limit worst-case delays
- Trickle behaviour split into separate thread
- SendMessages() split in two: original now only handles cs_main-dependent work
Add CaughtUp() function (needed by later commits)
Rearrange ProcessMessages + add nLastDataPos variable for partial message tracking.
Don't request blocks when block invs received unless it's the syncnode, or we've CaughtUp()
Force selection of a new syncnode since the current syncnode is about to stop sending blocks.
Replacement stalled block logic. Depending on the situation, it will either disconnect
the peer (as previous behaviour), or it will reselect a syncnode (e.g. when 500 blocks
have been received from the syncnode).
Add commandline option for sync timeout
Rename MarkBlockAsReceived to MarkBlockAsRequested to reduce confusion.
Show downloaded block size and time taken to download.
Debug when a block is incoming and show how many blocks still to come.
Add unauthenticated HTTP REST interface, to query public blockchain data
mempool janitor: periodic sweep and clean of not-confirming transactions

The mempool janitor ("poolman") is a thread that runs every -janitorinterval
seconds.  The janitor scans and removes memory pool transactions
older than current time minus -janitorexpire seconds.

By default, janitor runs every 24 hrs, expiring TXs older than 72 hrs.

IsMine() transactions are not touched.
RPC: Add 'sweepmempool' method, to manually initiate poolman
[Qt] Code-movement-only: Format confirmation message in sendcoinsdialog