Fix serialization of attached state

So the tree-view doesn't always show on reload.

Fixes #258
Merge pull request #299 from atom/mb-fix-attached-state-serialization

Fix serialization of attached state