Afghan national security adviser resigns