Make sure all arguments pub() passes to postMessage are structured-cloneable.

This avoids throwing an exception for code like 'catch(e) { pub("error", e); }'.