cmd/link: recompute heapPos after copyHeap
cmd/link: recompute heapPos after copyHeap

Immediately after a forward Seek, the offset we're writing to is
beyond len(buf)+len(heap):

|<--- buf --->|<--- heap --->|
                                    ^
                                    off

If we do a copyHeap at this point, the new heapPos should not be
0:

|<---------- buf ----------->|<-heap->|
                                    ^
                                    off

Recompute it.

For #42082.

Change-Id: Icb3e4e1c7bf7d1fd3d76a2e0d7dfcb319c661534
Reviewed-on: https://go-review.googlesource.com/c/go/+/270941
Trust: Cherry Zhang <d62e63aa42ce272d7b6a5055d97e942b33a34679@google.com>
Run-TryBot: Cherry Zhang <d62e63aa42ce272d7b6a5055d97e942b33a34679@google.com>
TryBot-Result: Go Bot <66cb808b70d30c07676d5e946fee83fd561249e5@golang.org>
Reviewed-by: Than McIntosh <4b2922593166fc595a9b1a408f34f5d3817fe9d2@google.com>

cloudflare/go,CAFxX/go,nawawi/go,CAFxX/go,cloudflare/go,cloudflare/go,golang/go,golang/go,CAFxX/go,CAFxX/go,nawawi/go,CAFxX/go,nawawi/go,CAFxX/go,nawawi/go,nawawi/go,cloudflare/go,cloudflare/go,cloudflare/go,nawawi/go,CAFxX/go,golang/go,golang/go,nawawi/go,golang/go,golang/go,cloudflare/go,nawawi/go,golang/go,cloudflare/go,CAFxX/go,golang/go