Fix database teardown for Django Liveserver

Server must be stopped before database teardown when using persistent
connections.