Fix serialization of objects with PHP5.3+ namespaces (RT#97864)

Fix for https://rt.cpan.org/Ticket/Display.html?id=97863