Fix forceClose() in KernelStatement.

Was off by one. Added a test for it.