Fix a compilation error under some Linux and under OSX

Fix a compilation error under some Linux and under OSX
Implement a strchrnul-like function