Add tests for killing a process

fixes #1264