Fix memory leak in special_{encode,decode}.
Destroy overlay timer on terminal destruction in selection-{autotransform,popup}.
Fix optimization in refresh for cells containing a space.

scr_refresh skips refresh for cells containing a space and whose
rendition attributes defining the bg color have not changed. However,
the computation of such attributes erroneously assumes that, if reverse
video is set, the bg color is given by the fg color, which is not true
in the case where bg == fg. This causes cells with a space and bg == fg
not being refreshed also when the reverse video attribute has changed,
as observed in red hat bug #830236. Fix the bug by amending the
attributes test so that the refresh of such a cell is performed if the
reverse video attribute has changed.