Fix bugs in git-annex cleanup method

Note to self: this isn't Ruby.

Seems the test wasn't ever hitting cleanup(), so this should exercise it properly across all platforms.