Screenwriters in the US say they have reached a tentative deal with studio bosses that could see them end a strike that has lasted nearly five months.