Mark nodes as 'in-use' before launching jobs

While we immediately lock a node given to us by nodepool, we delay
setting the node to 'in-use' until we actually request that the job
be launched so that if we end up canceling the job before it is
run, we might return the node unused to nodepool.

Change-Id: I2d2c0f9cdb4c199f2ed309e7b0cfc62e071037fa
diff --git a/tests/test_nodepool.py b/tests/test_nodepool.py
index b5b9b17..3019f08 100644
--- a/tests/test_nodepool.py
+++ b/tests/test_nodepool.py
@@ -78,6 +78,11 @@
             self.assertIsNotNone(node.lock)
             self.assertEqual(node.state, 'ready')
 
+        # Mark the nodes in use
+        self.nodepool.useNodeset(nodeset)
+        for node in nodeset.getNodes():
+            self.assertEqual(node.state, 'in-use')
+
     def test_node_request_disconnect(self):
         # Test that node requests are re-submitted after disconnect