Fix instance cross AZ check when attaching volumes

For CONF.cinder_cross_az_attach=False, we currently only check the desired AZ
during scheduling but don't actually check the final AZ of the node.

When attaching volumes to running instances we need to check the actual
AZ on the instance and not the desired AZ at boot time. The desired AZ
attribute is optional at boot and may not be set or the desired AZ
could be different from the final AZ.
When we are booting with a volume however we don't know the final AZ so we
check on the desired AZ.

Closes-Bug: #1255347
Change-Id: Ied912c171100a450754d315027bf5c407ac067bb
(cherry picked from commit 18a1486293b15c5713ac1352b9b9b30fdf2b7413)
postgresql: use postgres db instead of template1

In PostgreSQL template1 database is kind of special, as all new databases are
copied from it, when you do CREATE DATABASE. This implies a few restrictions:
e.g. you can't have more than one active session to template1, if one of them
tries to create a database. It will fail with:

    ERROR: source database "template1" is being accessed by other users

Using of postgres database instead of template1 resolves this issue.

Closes-Bug: #1355929

Change-Id: I8b1a36163984fbef6be66964456072d32da6a9d0
(cherry picked from commit 02fa15b4caaa414930b6ddf6a3a9fe8019751c26)
Merge "Fix instance cross AZ check when attaching volumes" into stable/icehouse
Merge "postgresql: use postgres db instead of template1" into stable/icehouse
Merge remote-tracking branch 'upstream/stable/icehouse' into stable/icehouse