SQLA 1.4: Fix calculate_resource_count
SQLA 1.4: Fix calculate_resource_count

SQLAlchemy 1.4 is failing on method calculate_resource_count with error:

  sqlalchemy.exc.ArgumentError: Query has only expression-based entities
  - can't find property named "XYZ_metadata".

Where XYZ is backup, snapshot, and volume.

This is most likely caused by SQLAlchemy not knowing what to do with the
joined loads once we replace the query using `with_entities`.

This patch fixes this issues by not doing unnecessary joined loads when
counting resources.

Closes-Bug: #1928085
Change-Id: I6b60106347aede024e5546f766453b4fec648cc2

mahak/cinder,mahak/cinder,openstack/cinder,openstack/cinder