fix: use homebrew async locking primitive to order file writing