Minor code cleanup.

Added scoped_descriptor for managing a socket descriptor resource.
Added missing include guards.
Added missing "const&" for various inferred types (auto).
Added cmake generated files for XCode to gitignore.
Removed naked malloc/free.
Removed "std::" qualifier in .cc files in favor of "using namespace std".
Removed unnecessary usages of "struct" in variable declarations.
Replace usages of NULL with C++11 nullptr.
Fixed version number in help output.