Add flag to prevent "list modified during sort"

Added flag/semaphore when sorting to avoid https://github.com/OpenBazaar/OpenBazaar/issues/801