Top safety researcher issues shock resignation from major tech firm, warning 'world is in peril'