Gov. Cooper vetoes bill barring public schools from teaching