jtag: cache vir.

Cache the last written vir so that we don't need to update it if we're
writing to the same DR again.
debugger: cache debug registers.

Cache the written value of debug registers so repeated writes of the
same value won't result in redundant transfers.  This gives a marked
improvement in test duration.

We can't cache the command register as writing actually starts the
command.