make sure that find_base_dir always returns a directory path, not a file path

Required for https://github.com/hpcugent/easybuild-easyblocks/pull/212, https://github.com/hpcugent/easybuild-easyconfigs/pull/314