Fix EZP-22409: Creating an object with relationlist fails when target cl...

...ass is being edited.

JIRA: https://jira.ez.no/browse/EZP-22409

This PR fixes an issue where creating a content with a relation to a ContentType which is being edited will fail.
This happens because a new row will exist in the `ezcontentclass` table, and the query performs a join without filtering version/status.

This PR resolves it by checking that the ContentType status is defined (aka "Published").