Fix tests on OSX.

Not sure why these started breaking.
Added t4156 - remove a generated dir and srcdir at the same time.

If things get removed in a particular order, we might end up with a non-existent tupid in the create_list. Obviously that is a bad idea. Instead we should convert a directory into a ghost node if its id is still in use as a srcid, and then delete it later.