Add polymorphic_pointer_downcast function template (pull request #2)

Existing polymorphic_downcast works with C++ built-in pointers only, while this new polymorphic_pointer_downcast is a more generic version with support for C++ built-in pointers, std::shared_ptr, boost::shared_ptr, boost::intrusive_ptr, etc.