Nearly three dozen tech companies have signed a pledge promising they won’t help governments carry out cyberattacks.