Fixed #23418 -- Fail when migration deconstruct produces invalid import

Ticket: https://code.djangoproject.com/ticket/23418