Fix synchronous directory removal

rimraf v2.2.7 fails to remove a directory synchronously.
For example, `rimraf.sync("foo/")` does not remove `foo` directory.

This PR fixes this problem.