The fraction of ionizing radiation from massive stars that escapes to the intergalactic medium