Merge iOS and OS X generation scripts.

Common code for both platforms is now output to a 'common' directory,
so Cocoapods process later do not overwrite one platform headers with
the other platform headers when both are used.

The script allows using two switches (--only-osx and --only-ios) if
one wants only one of the platforms generated, but, by default, it
generates both of them.

You can see more reasoning and my explanations to @zwaldowsky in zwaldowski/libffi-iOS#1