[#943] fix autotest connection refused - carefull not to reintroduce #1222 - implemented proposed fix by Matthias Kurz http://play.lighthouseapp.com/projects/57987/tickets/1222#ticket-1222-10