Fix --dump-manifest test instability in newer GCC versions
Fix problem with basedir in cwd with symlink

Root cause pointed out by ishikawa@yk.rim.or.jp.