Test for idempotent shutdown