added missing cleanup to nio.connect to close channel after process being terminated