Temporarily copied SerialExecutor.java from dependencymanager/core to dependencymanager/runtime, until we decide to store this class in utils. Also slightly modified the scheduleNext() method in order to avoid unecessary NoSuchElementException.