CMessageHeader sanity changes

- Remove spurious `pchCommand[1] = 1` in CMessageHeader()
- Make sure that pchCommand is zero-padded if length is shorter than
  COMMAND_SIZE
- Use strnlen to determine length of pcmCommand in GetCommand
Do merkle root and txid duplicates check simultaneously

Move the txid duplicates check into BuildMerkleTree, where it can be done
much more efficiently (without needing to build a full txid set to detect
duplicates).

The previous version (using the std::set<uint256> to detect duplicates) was
also slightly too weak. A block mined with actual duplicate transactions
(which is invalid, due to the inputs of the duplicated transactions being
seen as double spends) would trigger the duplicates logic, resulting in the
block not being stored on disk, and rerequested. This change fixes that by
only triggering in the case of duplicated transactions that can actually
result in an identical merkle root.
minor variable init changes in init.cpp

- explicit init of pcoinsdbview and pwalletMain (even if not needed, as
  globals are init to NULL, it seems cleaner)
- remove check if (pwalletMain) in Shutdown() as delete is valid even if
  pwalletMain is NULL
doc: Add instructions for consistent Mac OS X build names
Switch testing framework from MAIN to new UNITTEST network

UNITTEST inherites from MAIN but allows synamically changing its parameters using the ModifiableParams() interface
Suggested corrections on comments, variable names.
Also new test case testing the PoW skip in UNITTEST.
Avoid introducing a virtual into CChainParams

Treat fSkipProofOfWorkCheck the same as other parameters.
update getnetworkinfo help with subversion

- add missing subversion field to getnetworkinfo help
- fix style and format errors in help string
- remove unneeded int casts
remove dead/unused code in walletdb.cpp

- closes #5021
Merge pull request #5022

c375b5c remove dead/unused code in walletdb.cpp (Philip Kaufmann)
travis: enable windows tests
Merge pull request #5023

e9f3fa7 travis: enable windows tests (Cory Fields)
Merge pull request #4940

62e5f8f CMessageHeader sanity changes (Wladimir J. van der Laan)
Keep symlinks when copying into .app bundle

Code signing failed for me on OSX 10.9.5 because the
Versions/Current symbolic links were being replaced
with a duplicate copy of the frameworks' code.

Releases were bigger than they needed to be, for the
same reason.
When transaction outputs exceed inputs, show the offending amounts so as to aid debugging.
Print input index when signature validation fails, to aid debugging.
travis: If the comparison-tool fails, dump the tail of the debug log

The entire debug log would be huge, and could cause issues for automated tools
like travis. Printing 200 lines is an initial guess at a reasonable number,
more may be required.
Merge pull request #5024 from gavinandresen/osx_sign_fix

Keep symlinks when copying into .app bundle
build: Fix OSX build when using Homebrew and qt5

Qt5 is bottled, so configure won't find it without some help. Use
brew to find out its prefix.

Also, qt5 added the host_bins variable to pkg-config, use it.
build: macdeploy: filter out irrelevant qt5 frameworks and dylibs