PyGlomRelatedRecord: Initialize m_document and check it for null.

Found by Coverity Scan.
Dialog_FieldDefinition: Remove some unused member variables.

Found by Coverity Scan.