rts/linker: Only mprotect GOT after it is filled

This fixes a regression, introduced by 67c422ca, where we mprotect'd the
global offset table (GOT) region to PROT_READ before we had finished
filling it, resulting in a linker crash.

Fixes #16779.
20 jobs for master in 368 minutes and 59 seconds (queued for 4 seconds)
Name Stage Failure
failed
validate-aarch64-linux-deb9 Full Build
$ cp -Rf $HOME/.cabal cabal-cache
Uploading artifacts...
WARNING: ghc-*.tar.xz: no matching files
WARNING: junit.xml: no matching files
ERROR: No files to upload
Uploading artifacts...
WARNING: junit.xml: no matching files
ERROR: No files to upload
ERROR: Job failed: exit code 1
failed
validate-x86_64-windows Full Build
junit.xml: found 1 matching files                  
WARNING: Failed to load system CertPool:crypto/x509: system root pool is not available on Windows
Uploading artifacts to coordinator... ok
id=100478 responseStatus=201 Created token=P-xsv6Pw
Uploading artifacts...
Runtime platform
arch=amd64 os=windows pid=3432 revision=1f513601 version=11.10.1
junit.xml: found 1 matching files

WARNING: Failed to load system CertPool:crypto/x509: system root pool is not available on Windows
Uploading artifacts to coordinator... ok
id=100478 responseStatus=201 Created token=P-xsv6Pw
ERROR: Job failed: exit status 2
failed
release-x86_64-linux-deb9-dwarf Build
$ cp -Rf $HOME/.cabal cabal-cache
Uploading artifacts...
ghc-*.tar.xz: found 1 matching files
junit.xml: found 1 matching files

Uploading artifacts to coordinator... ok
id=100468 responseStatus=201 Created token=foq6ZJun
Uploading artifacts...
junit.xml: found 1 matching files

Uploading artifacts to coordinator... ok
id=100468 responseStatus=201 Created token=foq6ZJun
ERROR: Job failed: exit code 1