Move nextFile() from LinkingContext to InputGraph.

LinkingContext and InputGraph are unnecessarily entangled. Most linker
input file data, e.g. the vector containing input files, the next index
of the input file, etc. are managed by InputGraph, but only the current
input file is for no obvious reason managed by LinkingContext.

This patch is to move code from LinkingContext to InputGraph to fix it.
It's now clear who's reponsible for managing input file state, which is
InputGraph, and LinkingContext is now free from that responsibility.
It improves the readability as we now have fewer dependencies between
classes. No functionality change.

Differential Revision: http://llvm-reviews.chandlerc.com/D3259

git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@205394 91177308-0d34-0410-b5e6-96231b3b80d8
[TODO] revisit features TODO in the driver

git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@205395 91177308-0d34-0410-b5e6-96231b3b80d8