posix: Solaris doesn't have strnlen either

Not sure if this is the correct way to do this though.