SI-7426 Crash in pickler.

I wonder if the supply of copy-pasted code, and the bugs
which always accompany it, will ever run low. Here we have
a couple hundred lines of tree traversal which appears
roughly identical in structure to a different couple hundred
lines of tree traversal, except one calls methods called
putXXX and the other calls methods called writeXXX.

Except there was one call to writeXXX among all the putXXX
calls. Guess where it was crashing.

This entire file should be expunged.
Merge pull request #2458 from paulp/issue/7426-210

SI-7426 Crash in pickler.