unlock and close cachefile if we bail out of socket creation.
remove one of the ctrl-c checks in socket creation