Fix logical check against old_public_key in upload_public_key

Signed-off-by: Amr Ali <amr@databracket.com>