Add test detecting source deadlock.

Add test which ensures that the AAE source worker doesn't deadlock when
waiting for responses from the process which is computing the hashtree
differences.

Unfortunately, this test uses timeouts because as the code currently
stands, I can't figure out a way to make it any cleaner.

Let me know how this looks and we can explore a 1.4 backport.