FBI Director Chris Wray resigns to avoid being terminated