If an error happens in `set`, still check before calling the callback

This may cause the whole app to crash as a callback simply might be unset for `cache.set()`.