message: [Process] Use early returns in Process::WriteMemory (NFC)
  I found the code of Process::WriteMemory particularly hard to follow
  when reviewing Ismail's change in D60022. This simplifies the code and
  hopefully prevents similar oversights in the future.
diff: @@ -2209,20 +2209,21 @@ size_t Process::WriteMemory(addr_t addr, const void *buf, size_t size,
  // may have placed in our tasks memory.
  BreakpointSiteList bp_sites_in_range;
  + if (!m_breakpoint_site_list.FindInRange(addr, addr + size, bp_sites_in_range))
  + return WriteMemoryPrivate(addr, buf, size, error);
  - if (m_breakpoint_site_list.FindInRange(addr, addr + size,
  - bp_sites_in_range)) {
  // No breakpoint sites overlap
  if (bp_sites_in_range.IsEmpty())
  return WriteMemoryPrivate(addr, buf, size, error);
  - else {
  +
  const uint8_t *ubuf = (const uint8_t *)buf;
  uint64_t bytes_written = 0;
  bp_sites_in_range.ForEach([this, addr, size, &bytes_written, &ubuf,
  &error](BreakpointSite *bp) -> void {
  + if (error.Fail())
  + return;
  - if (error.Success()) {
  addr_t intersect_addr;
  size_t intersect_size;
  size_t opcode_offset;
  @@ -2241,8 +2242,8 @@ size_t Process::WriteMemory(addr_t addr, const void *buf, size_t size,
  // There are some bytes before this breakpoint that we need to just
  // write to memory
  size_t curr_size = intersect_addr - curr_addr;
  - size_t curr_bytes_written = WriteMemoryPrivate(
  - curr_addr, ubuf + bytes_written, curr_size, error);
  + size_t curr_bytes_written =
  + WriteMemoryPrivate(curr_addr, ubuf + bytes_written, curr_size, error);
  bytes_written += curr_bytes_written;
  if (curr_bytes_written != curr_size) {
  // We weren't able to write all of the requested bytes, we are
  @@ -2254,23 +2255,18 @@ size_t Process::WriteMemory(addr_t addr, const void *buf, size_t size,
  }
  // Now write any bytes that would cover up any software breakpoints
  // directly into the breakpoint opcode buffer
  - ::memcpy(bp->GetSavedOpcodeBytes() + opcode_offset,
  - ubuf + bytes_written, intersect_size);
  + ::memcpy(bp->GetSavedOpcodeBytes() + opcode_offset, ubuf + bytes_written,
  + intersect_size);
  bytes_written += intersect_size;
  - }
  });
  + // Write any remaining bytes after the last breakpoint if we have any left
  if (bytes_written < size)
  - return bytes_written + WriteMemoryPrivate(addr + bytes_written,
  - ubuf + bytes_written,
  + bytes_written +=
  + WriteMemoryPrivate(addr + bytes_written, ubuf + bytes_written,
  size - bytes_written, error);
  - }
  - } else {
  - return WriteMemoryPrivate(addr, buf, size, error);
  - }
  - // Write any remaining bytes after the last breakpoint if we have any left
  - return 0; // bytes_written;
  + return bytes_written;
  }
  size_t Process::WriteScalarToMemory(addr_t addr, const Scalar &scalar,
  