Fix query.js test code to be more deterministic
Fix query.js test code to be more deterministic

FAB-2791
the test/integration/query.js has a lot of promise chains that
get tangled together that caused the execution of the test suite
to be sensitive to timing. as a result the same code was
successful in x86 build but fails in z390 build. and in theory
it could fail from time to time in x86 as well.

Fix is to re-organize the promises to make sure all tests are
executed in sequence.

Change-Id: I2964c43383cdea84f3e4c23c967f8cfb498e8b13
Signed-off-by: Jim Zhang <6775950e159d0bc2e58935ca2201ba88526dddf0@us.ibm.com>

adityachap/fabric-sdk-node,ratnakar-asara/fabric-sdk-node,ratnakar-asara/fabric-sdk-node,ratnakar-asara/fabric-sdk-node,adityachap/fabric-sdk-node,ratnakar-asara/fabric-sdk-node