Fix forceClose() in KernelStatement.

Was off by one. Added a test for it.
Can we fix this by refactoring the close logic? maybe by having a `doClose` that doesn't check for `release()`?