Wq race condition removed.

Cores are now reported last. As long as cores remains 0, the master will not give a task to it. This allows for the rest of the resources to report successfully. @btovar please review this code. #178