Try to fix duplicate entry of variable into cache table

This is #37 from https://drupal.org/node/561990