use Python3 compatible syntax for 'except'
Specify TEST_NAME in test settings to make concurrency tests work on sqlite.

Django 1.6 checks for this setting and defaults to None, which creates an in-memory database
when using sqlite. This causes our race condition test in wagtailimages to fail, since it's
not possible for multiple threads to share the same in-memory database.