Fix segfaulting on strstr() failure

See https://groups.google.com/forum/#!topic/julia-dev/aMWL08cQDsc for details
Merge pull request #5026 from JuliaLang/sf/chriskohlheppfix

Fix segfaulting on strstr() failure