multiwallet: refactor, add error checking, add a "stopall" option.

This is about the multiwallet tool:
- refactor the main function by extracting code blocks into separate functions for starting/stopping btc/wallets;
- add error checking where useful (the createencryptedwallet seems to be failing all the time);
- rename the "closewallet" option, and related code, to "stopwallets", because processes are started and stopped, not closed;
- add handling of the btcd pid file;
- add a "stopall" option that stops the btcd daemon and all the wallets too.

Sorry for the obsolete branch name, too lazy to change it. :-)