Fix valgrind nightly testing.

I moved a block into the global scope in #647 that caused a DIRFILE to be created, which included directories such as ./Share that are not intended to be run. Move that part of the block back to its original location, leaving the half that concats testdirs onto testflags when not using paratest.