[JENKINS-25514] Fixed lock case in FutureImpl
when some other process is waiting for build in queue.