Use dup2() to make message queue tests less flaky.

We're trying to test situations where a file descriptor number
gets reused after a file has been closed.  For that, it's better
to use dup2() to explicitly simulate this situation rather than
relying on timing and luck.

Change-Id: If86cdbe4246a7a1b9eeddd1c32a76559c4cf09c6
1 file changed