Improve scoped_pipe and add tests

Since dup2'ing an fd is fairly common in mettle (and caliber), add move_read
and move_write to scoped_pipe to handle the dup2 + close action in one step.