Fixes a race condition causing stalls when pausing/cancelling
Fixes a race condition causing stalls when pausing/cancelling

Closes #2581 & closes #2587

Jaesin/OctoPrint,Jaesin/OctoPrint,foosel/OctoPrint,foosel/OctoPrint,foosel/OctoPrint,Jaesin/OctoPrint,Jaesin/OctoPrint,foosel/OctoPrint