[SPARK-1600] Refactor FileInputStream tests to remove Thread.sleep() calls and SystemClock usage

This PR refactors Spark Streaming's FileInputStream tests to remove uses of Thread.sleep() and SystemClock, which should hopefully resolve some longstanding flakiness in these tests (see SPARK-1600).

Key changes:

- Modify FileInputDStream to use the scheduler's Clock instead of System.currentTimeMillis(); this allows it to be tested using ManualClock.
- Fix a synchronization issue in ManualClock's `currentTime` method.
- Add a StreamingTestWaiter class which allows callers to block until a certain number of batches have finished.
- Change the FileInputStream tests so that files' modification times are manually set based off of ManualClock; this eliminates many Thread.sleep calls.
- Update these tests to use the withStreamingContext fixture.
This Thread.sleep call was to ensure that we're actually inside a `fileStream.map` task when the context shuts down.  This might not be necessary given the `waitForTotalBatchesStarted` call on the previous line.  AFAIK, the reason why I had this here was that `waitForTotalBatchesStarted` might fire after streaming starts the batch but before the underlying Spark jobs start.  If we do need to block until Spark itself actually begins the processing, then that could be a little trickier.  I suppose I could just use a SparkListener for that.

I toyed around with the idea of using a semaphore, but that's tricky because you want to ensure that the task and the caller have the same Semaphore object in the JVM.  Since the task is serialized, you effectively have to have a global object with a hashmap that holds the semaphore, which is a bit messy.