Cherry-pick "[vm, bytecode] Fix package splitting when main is empty."

Merge commit '97f14cced13a240a3f2a3d7d91e939deb15a5602' into fuchsia-cherry-picks

Change-Id: I2274ab8656835e03e693d3d46177af2de43789f6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/120020
Reviewed-by: Alexander Markov <alexmarkov@google.com>