Make model_base work with sqla 0.7.X

The sqla.inspect module has been introduced in sqla 0.8.X but it could be
replaced with sqla.orm.attributes.instance_state that works ok with both
0.7.X and 0.8.X versions.

Change-Id: Ib78e73f3b94dc7a45f6747dd2fa00f8303144109
Merge "Make model_base work with sqla 0.7.X"