close db migration session

Explicitly close sessions in db migration 022. With the postgresql backend
if the session is not closed explicitly it leaves a user of the db behind
which can cause problems later on

Fixes bug #1158544

Change-Id: I389b83397addc5901aa94b584856fbd7f5cef485
fix undefined variable

An undefined variable was used in the trust kvs backend, this
fixes it.

Change-Id: I9c25d85ab64afa2bf7639d3fd14a4d6839dacb64
Merge "close db migration session"
Merge "fix undefined variable"