Swalwell, a Democrat, said the threats have forced him to change his habits and his office's approach to security.