QPID-4579: Fixes building Qpid under the latest GCC (4.8.0).

Moves the definition of Functor and MemFuncRef out of Handler class
definition. Fixes the build failure in later versions of GCC.

Contributed by: Petr Machata <pmachata@redhat.com>