scheduler: correct attempts decrement and releasing of failed commands