US pastor's detention in 2016 for links to groups behind a coup bid created diplomatic crisis between two NATO allies.