Fix in-memory cache hit misses when using processor directives.

Fixes https://github.com/sstephenson/sprockets/issues/432

It took me a while to wrap my head around everything but I'm pleased with how this patch turned out. Apologies in advance for not adding a test, I seriously couldn't figure out the best way to test this.

Thanks.