Saying everyone has the right to a “safe, secure workplace,” Gov. Kathy Hochul closed a loophole that held state elected officials exempt from the consequences of sexual harassment because they were not technically employed by the state or a municipality.