Fix checking if connectors are included by a defined constant instead of a get_included_files() check.

This resolves an edge case scenario where a file that is automatically prepended (e.g. auto_prepend_file) causes the included check to fail as the connector.php is not the first file in get_included_files(). The entire manager becomes unusable in this case, as none of the AJAX requests work as expected.

The new check per this commit first checks the existence of a constant (which the other connectors define). As alternative, it also checks if the MODX_CORE_PATH is defined, which is a pretty good indicator that for example a third party connector loaded the main connector (as they can't find the connector location, without knowing the location of the core and loading the config file).
Refactor validation of a connector being included

Resolves #11738

Merge remote-tracking branch 'origin/pr/11748'

* origin/pr/11748:
  Fix checking if connectors are included by a defined constant instead of a get_included_files() check.