Violence, security threats cast pall over Pakistan’s elections