Explicitly set MIDDLEWARE_CLASSES for tests

Django 1.7 pared down the default MIDDLEWARE_CLASSES, so we have to
explicitly include auth and sessions.
Tests for buggy object creation with preset PK

There is a serious bug causing ConcurrentUpdate be raised
whenever a new model instance is to be saved with the PK
value set in advance. The added test catches the bug.
Fix buggy creation of object with preset PK