Slurm should retry the 'dw_wlm_cli --function teardown ...' call until it succeeds. It may wish to sleep in between re-tries but if it gives up there's no guarantee that the DWS state gets cleaned up.
Retry added with 5 second sleep between retries: https://github.com/SchedMD/slurm/commit/789f5c7edb09ca6a315d2f926abfd4be0fd41e5e Change will be in version 15.08.5 when released, likely mid-December