Handle package files that failed to download

Awesome work on this stuff, @dcarp. I integrated it in one of my projects, this was the only issue I ran in to. Also, shouldn't there be a link_directories command somewhere, or did you intentionally leave that up to the user for e.g. optlink sillyness?