Fix index out of bound error in Engine::ready_queue_size when called before start_threads
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/30967
Test Plan: Imported from OSS
Differential Revision: D18887178
Pulled By: mrshenli
fbshipit-source-id: 67baeac9214a4749ce7e9b4d89862c93620b2d5e