[1.7.x] Removed unused imports in makemigrations

Backport of fc32e9c0d from master.