Stability of spin-driven ferroelectricity in the thin-film limit: coupling of magnetic and electric order in multiferroic TbMnO3 films