runtime: do not attempt bulkBarrierPreWrite when dst slice length is zero
runtime: do not attempt bulkBarrierPreWrite when dst slice length is zero

If dst slice length is zero in makeslicecopy then the called mallocgc is
using a fast path to only return a pointer to runtime.zerobase.
There may be no heapBits for that address readable by
bulkBarrierPreWriteSrcOnly which will cause a panic.

Protect against this by not calling bulkBarrierPreWriteSrcOnly if
there is nothing to copy. This is the case for all cases where the
length of the destination slice is zero.

runtime.growslice and runtime.typedslicecopy have fast paths that
do not call bulkBarrierPreWrite for zero copy lengths either.

Fixes #38929

Change-Id: I78ece600203a0a8d24de5b6c9eef56f605d44e99
Reviewed-on: https://go-review.googlesource.com/c/go/+/232800
Reviewed-by: Keith Randall <8c99c3a9284e493be632950b84cd789d08ed3e9d@golang.org>

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