Fix LevelDB 197 on OS X

Here's the gist of what's going wrong:

1.  PosixMmapFile is used for performing sequential writes.  Internally, it maps
    regions of the file one after the other.  Each region is unmapped before the
    next region is mapped.

2.  In some circumstances on OS X, the unmapped data is not written to disk.

The fix is to perform a msync before the munmap on OS X, which seems to be where
this issue manifests itself most.

Note:  Simply performing a write with the `sync' option is not a sufficient fix
    because the sync will happen after the munmap.
Explictly cast calculation to int, to allow std::max to work.
Add missing 0x prefix in chainparams.cpp

Conflicts:
	src/chainparams.cpp
Bugfix: Move boost/version include from db.cpp to walletdb.cpp where BOOST_VERSION is used
fix invalid conversion error with MinGW 4.8.1 in net.cpp

- fixes src\net.cpp:1601: Error:invalid conversion from 'void*' to
  'const char*' [-fpermissive] in a setsockopt() call on Win32 that was
  found by using MinGW 4.8.1 compiler suite
fix typo in README.md
Fix typo in README.md
Make the rand tests determinstic. (fixes #2714)

This avoids spurious errors with the old tests but still tests
 enough that if the rng is replaced with a totally broken one
 it should still fail.
Update HomeBrew osx makefile patch to account for recent changes to makefile
fix comment about dust logic

Conflicts:
	src/core.h
Add wtogami to gitian download scripts.
Create parent directories if needed in GetDataDir

One-line change. Fixes #2752.
Made the build/release process completable verbatim as listed in
release-process.md

Conflicts:
	doc/release-process.md
Fix memory leak on exception in Key::SignCompact
fix memory leak in CKey::SetCompactSignature()
Don't attempt to resize vector to negative size.
Fix typo in a comment: it's base58, not base48.
Bitcoin-Qt: Fix display of window when bitcoin: URI is opened

WalletView:
- add new signal showNormalIfMinimized()
- emit the new signal in handleURI() to fix a bug, preventing the main
  window to show up when using bitcoin: URIs

Upstream: dbc0a6aba2cf94aa1b167145a18e0b9c671aef5b
Release notes for 0.8.6