Polarization creation by beam-foil interactions for projectile fragments produced in high-energy heavy-ion collisions and NMR detection of short-lived β-emitting 39Ca