Fix for Bug 456307 - Close statement while cannot cancel it.

Signed-off-by: xinzhao-acutate <xzhao@actuate.com>