Merge pull request #2568 from sipa/rlimit

Try to increase file descriptor rlimit if necessary
Thread-safety: use gmtime_r instead of gmtime
Add ExtractAffectedKeys to script

This function finds all keys affected by a particular output script,
supporting everything ExtractDestinations supports (pay-to-pubkey,
pay-to-pubkeyhash, multisig) and recurses into subscripts (P2SH).
Add GetKeyBirthTimes to wallet

Compute safe lower bounds on the birth times of all wallet keys. For
pool keys, the actually stored birth time is used. For all others,
the birth times are inferred from the wallet transactions.

Once support for generic key birth times is added, this function can
be used for one-time upgrading.
Add dumpwallet and importwallet RPCs

dumpwallet: produce a dump of all keys in a wallet, in a format
compatible with Bitcoin Wallet for Android and Multibit.

importwallet: import such a dump