Thousands of British prison officers walked out of their jobs on Friday, gathering outside jails to protest against what their union called unprecedented levels of violence and the failure of the government to make prisons safe.