A report by the secretary general warned that new technologies could be used to access and criminalize people’s innermost thoughts.