Handle serialization of Closures

Closures (anonymous functions) cannot be serialized, so trying to
store the raw exception through serialize() will cause another
Exception to occur.