check redis is installed before executing a command, prevent a maybe possible security issue by making sure to always restore the environment in case of any exception. Otherwise we would maybe run code that handles the exception in the context of another environment which in turn could leak data from eg $_SERVER etc. as we send the response already earlier this can be in theory not an issue but just to be sure...