Fix formatting and a bug. Fixes #30.

The bug was caused by a wrong assumption that individual write_sgr functions
are there for optimization purposes. They are not. Their purpose is to make
TB_DEFAULT work. Therefore TB_DEFAULT != lastfg/lastbg. In fact the send_attr
puts SGR0 as soon as it detects deviation from lastfg or lastbg, which means
the actual attributes are equal to terminal defaults from that point.

The fix restores the previous logic for NORMAL mode and forces a complete
update for other output modes. Again, complete doesn't mean less optimized, it
was complete in most of the cases before as well. The update happens partially
only if the TB_DEFAULT is involved.