Use MAXPATHLEN+1 for size of dirname_ rather than hardcoded number.

It's what it's there for.