don't generate TypeErrors for Marshal.dump

While running memory-profiler found that Marshal.dump used for calculating sizes wasn't spelled correctly.
The other change in this pull request is to check whether an object can be marshaled without actually trying. This avoids generating a TypeError object for each Marshal.dump call. The exceptions accumulate over a large run, and cause confusing reports.