Added guard to object key pickling.

This makes sure to not explore a undefined branch of when printing.