[RFC] Fix SegFault when entering Command(q:) or Search(q/) History

For some reason `if ((p = vim_strrchr(fname, '/')) != NULL)` was firing even when `vim_strrchr(fname, '/')` returns NULL. Control reaches `STRNCPY(relative_directory, fname, p-fname);` with `p == 0`, so the `p-fname` causes a segfault. This happened in both debug and release builds.
I do not know if this issue is present across more machines but this PR fixes it for me at least.

On the off chance of it being a system specific issue here are my details:
Ubuntu 14.10 64bit
Intel Core i7-2630QM
gcc version 4.9.1