Sir Alan Duncan resigns as minister