Purge keys after a timeout to avoid race conditions.