fix pip plugin

I had a couple problems with the pip plugin:

* It seemed to expect GNU sed and broke with BSD (read: OSX) sed. I've tested this version with both.
* It didn't create the parent directory of the cache file if it didn't exist apparently just due to a typo.