Hollywood writers have for decades penned sci-fi scripts featuring machines taking over the world. Now, they are fighting to make sure robots do not take their jobs.