Don't check ctx.Err() unless ctx.Done() was closed.

@alainjobart 

The zktopo lock tests have been flaky, with errors saying "interrupted".
This was because there's a race condition where ZK can time out before
the ctx.Done() channel has been closed, so ctx.Err() returns nil and we
return the wrong topo error (interrupted instead of timeout).