Fix lazy load 'system_metadata' failed problem.

When using lazy load of SQLAlchemy, parent instance may have
a problem not bouding to a session object and fail the lazy loading
system_metadata.
Using joinedload to eagly load the system_metadata in
_instance_get_all_query to fix the problem.

Fixes: bug 1117232
Change-Id: Id24ca534f6eb57167aee22aca12c1274c90baf3c
Merge "Fix lazy load 'system_metadata' failed problem."