Added test case to check for an intermediate swappable model change in migration state

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