Add -zapwallettx function, a diagnostic tool to assist in wallet repair

It is somewhat suboptimal in that it loads every wallet record, when it really should just scan keys.