Make statement cancellation behavior consistent.   This reduces the chance
of random failure in the regression test.

Initially reported and submitted by Masataka Saito.

This could be a quick hack but work well until we have more robust handling
of statment cancelation.