fix removeTempDirectory usage. fix bad usage of brackets.fs.stat 'spy'

Fix for #5253

@JeffryBooher can you review? Unfortunately I still see 3 live dev failures even with my fixes. Will continue working on this tonight. Just wanted to see if this fixed your inline editor provider failures.