Msleep not constant

There are two, almost invisible, fixes to the MSleep (Sleep) function here.

* Ensure the sleep function only gets called during the query execute (not optimize) by setting the neverConstant() flag for the function. 
* If the sleep in interrupted by a query cancellation, make sure to throw the correct QueryCanceledException so everyone back to the client is happy