US agrees to drop foreign agent prosecution against former CIA analyst