rtl/cache: implement a dirty bit.

The dirty bit is set when a cache line is written to.  When we evict or
flush we only actually have to write back to the memory if the line is
dirty.  If not then we can just mark it as invalid to save some write
cycles.