Removed ugly macros for the shared_ptr locking and libc++ dependency.

Now, with templates we autodetect whether shared_ptr supports its atomic overloads
and default to a locking implementation if it doesn't.