Ensure credentials cleaned up on exception

Merge after PR#90.

This one adds additional `settings.DATABASES` cleanup on exception.