data-sort: remove base on swap failure
data-sort: pedantic fixes
data-sort: move blocking operations outside of the lock
data-sort: move removal of unsorted base to separate subroutine