build: osx: Fix incomplete framework packaging for codesigning

Starting with 10.9, Framework versions must be signed individually, rather
than as a single bundle version, in order to be properly codesigned. This
change ensures that the proper plist files and symlinks are present prior to
packaging.
Make script_{valid,invalid}.json validation flags configurable
Use explicit fflush() instead of setvbuf()

Flushing after every line when printing to console is desirable when
running with systemd but setvbuf() has slightly different semantics
on Windows that causes warnings.  Just do an explicit fflush() after
each line print to console instead.
Stricter handling of orphan transactions

Prevent denial-of-service attacks by banning
peers that send us invalid orphan transactions
and only storing orphan transactions given to
us by a peer while the peer is connected.
Store fewer orphan tx by default, add -maxorphantx option

There is no reason to store thousands of orphan transactions;
normally an orphan's parents will either be broadcast or
mined reasonably quickly.

This pull drops the maximum number of orphans from 10,000 down
to 100, and adds a command-line option (-maxorphantx) that is
just like -maxorphanblocks to override the default.
Merge pull request #4892

e982b57 Use explicit fflush() instead of setvbuf() (Adam Weiss)
Merge pull request #4885

aa3c697 Store fewer orphan tx by default, add -maxorphantx option (Gavin Andresen)
c74332c Stricter handling of orphan transactions (Gavin Andresen)
Catch error when done reading files
Merge pull request #4758 from theuni/osx-dmg-codesign-rebase

build: osx: Fix incomplete framework packaging for codesigning
Merge pull request #4876

6022b5d Make script_{valid,invalid}.json validation flags configurable (Pieter Wuille)
Merge pull request #4896

07d5287 Catch error when done reading files (Suhas Daftuar)
Bugfix: bitcoin-tx: scriptPubKey may be null, so accept outscript=<n>:
bitcoin-util-test: Test bitcoin-tx with null scriptPubKey
cleanup new script files (no code changes)

- add missing header end comments
- ensure alphabetical ordering
- update copyright year and license
Merge pull request #4881

2d79bba cleanup new script files (no code changes) (Philip Kaufmann)
Merge pull request #4909
Rearrange macosx build instructions since homebrew is preferred to macports.