fix encode (output) for oldlogstashjson codec.

It was referencing the obj variable which didn't exist