refactor to use same connection in middleware TODO: put connection in config pylons global
Error checking for IntegrityError
closes accounts now
Better error handling

Conflicts:
	mediacore/lib/auth/middleware.py