Fix struct encoding

There was accidentally an extra empty dict.  Also, reduce the scope of a
local variable.
Merge pull request #15 from dgryski/encode-struct-extra-dict

Fix struct encoding