After five months, the writers have reached a tentative agreement with movie studios