Make 'cabal init' (somewhat) sandbox-aware.

Fixes #1555.