Remove unused method and make getPendingBuild query atomic and concurrent-safe.