Modify dup2_test program for new syscall functionality

Modify the dup2_test program to also test `dup2` functionality if our
destination file descriptor has not been opened.