Attach (recommended) or Link to PDF file here: [ACORD 0211 2016-09 Acroform BLANK.pdf](https://github.com/mozilla/pdf.js/files/6353664/ACORD.0211.2016-09.Acroform.BLANK.pdf)

Configuration:
- Web browser and its version: Google Chrome Version 90.0.4430.72 (Official Build) (x86_64)
- Operating system and its version: Windows 10 Pro 20H2
- PDF.js version: 2.7.570
- Is a browser extension: No

Steps to reproduce the problem:
1. Load attached form into PDFViewer
2. Call saveDocument method on loaded document proxy

What is the expected behavior: should not crash

What went wrong? (add screenshot)
It crashes in writer.js. Line 273 as of 21 Apr 2021.
![image](https://user-images.githubusercontent.com/10527821/115615989-4d747900-a2f8-11eb-8e6a-fa3070d813a7.png)

Line that crashes: 
![image](https://user-images.githubusercontent.com/10527821/115616056-6846ed80-a2f8-11eb-8df1-b4633d3e5e8e.png)

Potential fix: 
![image](https://user-images.githubusercontent.com/10527821/115616270-af34e300-a2f8-11eb-82c9-c13bfd111fe4.png)

Potential fix is based on this line if worker.js file: 
![image](https://user-images.githubusercontent.com/10527821/115616437-e0151800-a2f8-11eb-947c-d89e72774bd5.png)


Link to a viewer (if hosted on a site other than mozilla.github.io/pdf.js or as Firefox/Chrome extension): not hosted

data = bytesToString(data);
      const expected =
        "\nabc\n" +
        "defg\n" +
        "789 0 obj\n" +
        "<< /Size 790 /Prev 314 /Type /XRef /Index [0 1 123 1 456 1 789 1] " +
        "/ID [(id) (\x01#Eg\x89\xab\xcd\xef\xfe\xdc\xba\x98vT2\x10)] " +
        "/W [1 1 2] /Length 16>> stream\n" +
        "\x00\x01\xff\xff" +
        "\x01\x01\x00\x2d" +
        "\x01\x05\x00\x4e" +
        "\x01\x0a\x00\x00\n" +
        "endstream\n" +
        "endobj\n" +
        "startxref\n" +
        "10\n" +
        "%%EOF\n";
      expect(data).toEqual(expected);
    });
  });
  describe("writeDict", function () {
    it("should write a Dict", function () {
      const dict = new Dict(null);
      dict.set("A", Name.get("B"));
      dict.set("B", Ref.get(123, 456));
      dict.set("C", 789);
      dict.set("D", "hello world");
      dict.set("E", "(hello\\world)");
      dict.set("F", [1.23001, 4.50001, 6]);
      const gdict = new Dict(null);