Fix potential race in tests
Fix potential race in tests

The waitForNodes method was subject to the following race:

main thread: create a db record for a new node
test thread: verify that no nodes need to be created
test thread: verify that no launch threads are running
test thread: exit
main thread: spawn the launch thread for the new node

This change ensures that there are no nodes in the BUILDING state
before assuming that the system is stable.

Change-Id: I48f0c34c76e40c8fe8deff548100f7868c96428d

Tesora/tesora-nodepool,Tesora/tesora-nodepool,seandst/nodepool,seandst/nodepool,citrix-openstack/nodepool,citrix-openstack/nodepool