fix sync_request in multi threading

When two threads send sync_requests  at the same time, one of them waits for the other to finish serving. If the second response is faster than the first, the first thread will receive and store the second response. The second thread did not realize this and waits for his response for ever.