Pipe cursor should create and close own connection