Update all management commands to close the DB connection.

This seems to be a bug in the Django version we're using?