Use fixed size thread pool in NGInputStream, fix race condition and simplify synchronization.