function _prepareTmpFileRemoveCallback(name, fd, opts, sync) {
  const removeCallbackSync = _prepareRemoveCallback(_removeFileSync, [fd, name], sync);
  const removeCallback = _prepareRemoveCallback(_removeFileAsync, [fd, name], sync, removeCallbackSync);

  if (!opts.keep) _removeObjects.unshift(removeCallbackSync);

  return sync ? removeCallbackSync : removeCallback;
}
Prepares the callback for removal of the temporary file.

Returns either a sync callback or a async callback depending on whether
fileSync or file was called, which is expressed by the sync parameter.

@param {string} name the path of the file
@param {number} fd file descriptor
@param {Object} opts
@param {boolean} sync
@returns {fileCallback | fileCallbackSync}
@private