Test shutdown then kill

Add test for #1117.