Fixups for dsm.c's file descriptor handling.

Per complaint from Tom Lane.