[1.6.x] Fixed #21451 -- Fixed LiveServerTestCase 404

Thanks to Aymeric Augustin for the report and initial patch.

I have't really done a whole lot on this, other than test that this does indeed fix the issue described in the ticket, and add a few small comments.

The ticket also mentions not applying the StaticFilesHandler if `STATIC_URL` is not defined. I did some investigating on this by writing a test and found that if the STATIC_URL is not set, the test was throwing an exception complaining about using the staticfiles app, but not having STATIC_URL set. Some more investigating[1] found that in Django 1.6 the LiveServerTestCase used the staticfiles contrib app, which requires STATIC_URL to be set. I don't see a way around this. If anyone has any suggestions, let me know.

[1] https://docs.djangoproject.com/en/1.6/topics/testing/tools/#django.test.LiveServerTestCase