Closed the half of pipe that dup2 used.

Originally I closed only one half of the pipe but realized since I
called dup2() on the other half, I can close it too. Tested it and it
still works