Fix fingerprint cache overwriting valid keys

This also fixes an authentication error in some cases.

Signed-off-by: Daniele Ricci <daniele.athome@gmail.com>