Compile on Mavericks

In 10.8, Apple switched the compiler from gcc to clang.

This fixes a whole bunch of things that clang catches that
gcc doesn't. A large part of this patch is explicitly qualifying
boost::shared_ptr<>.
Don't generate empty text surfaces.

If the new bitmap aware text layout algorithm says it needs
no space (for example, because it is trying to render ""),
then it should still allocate a non-empty surface.

Closes GH-50