common: Protecting against empty ${dir} variable

If common_setup is called without dir variable properly set, that will
kill the local system instead of patching the destination.

This was the case of some upgrade-from calls prior commit 36907a7eb8963f781c33060052afee0e95d37d6f.

This patch add a protection that stops the build process if dir variable
isn't set.