Set 'haddockDistPref' to the right value when working inside a sandbox.

Fixes #1332.