signals: Add _signalHandlerIsConnected method
This adds a method from the Cinnamon maintained fork of GJS for determining whether or not a signal is connected to a JS object. In Cinnamon the code is used as a part of the signal manager utility.
This is originally based on an older CJS commit, and modified for an optimization. For loops are faster than for..of in Spidermonkey.
The pipeline seems to be failing because of eslint errors that are not from this commit, but I did check to make sure the test is passing locally. I can clean up the remaining lint errors in that file if preferred.