Add check to prevent overwriting hooks everytime.

Fixes a bug where the hook scripts are overwritten everytime wineenv is
sourced.
Provide special variables to hook scripts.