Effect of crystal defects and internal stress on the domain structure and magnetic properties of magnetite