Fix transaction signature cache.

The Transaction#sign method would notice that a previous signature was still
valid and skip signing again. Great, except it would throw the old
signature away first, leaving no signature at all. Fixed.