Add spawncwd() function

This function's body is from stage-cwd patch. Instead of spawning child
processes with the same cwd as the current process, spawncwd() spawns
processes with cwds based on the title of the focused client.