Add .gitattributes and cleanup .gitignore

Exclude development-only files from the distribution tarball.
Minor overhaul of the Mac OS X hacks
Only use -pthread on non-Darwin systems
Suppress SPDY/QUIC by removing Alternate-Protocol headers
Make session.pem generation more portable
Lint fix: define some variables in smaller scope