fix asyncio worker handling

New branch based on latest patch from @berkerpeksag in #846 . All tests pass. 

Please review!