runCallbacks = (callbacks, err, result) => {
	if (callbacks.length === 1) {
		callbacks[0](err, result);
		callbacks.length = 0;
		return;
	}
	let error;
	for (const callback of callbacks) {
		try {
			callback(err, result);
		} catch (err) {
			if (!error) error = err;
		}
	}
	callbacks.length = 0;
	if (error) throw error;
}
@template T
@param {FileSystemCallback<T>[]} callbacks callbacks
@param {Error | null} err error
@param {T} result result