fix copyOut close hanging bug #161 from epgrubmair