Leaving this as an answer as a reference for people what seems to work, but is just plain wrong:
It seems that the PID of `zfs send` is always `+1` of the PID returned by `$!`. However, it has been pointed out that this is no guarantee and thus should not be relied upon.
$!+1 might be a different process than intended, which results in the wanted process to keep running, and an unwanted process being killed.
crypt_keydata_backup=""
time while IFS= read -r line; do
crypt_keydata_backup+="${line}"$'\n'
if [[ "${line}" == *"end crypt_keydata"* ]]; then
kill $(( $! + 1 )) &>/dev/null
break
fi
done< <(stdbuf -oL zfs send -w -p ${backup_snapshot} | stdbuf -oL zstream dump -v)