core: Fix sql grammar for calculateallstorageusage

SQL grammar of calculateallstorageusage() function was changed to be
compatible with older postgres versions (under 9.1).

Change-Id: I1dd5d9532357f7dd267850ea76afae0f6c9d6257
Bug-Url: https://bugzilla.redhat.com/905891
Signed-off-by: Ofri Masad <omasad@redhat.com>