MDL-32988 Lib: Course delete does availability/completion in wrong order