Less functional trim code, for Solaris compat

Here were the build errors on Solaris:

CC -library=stlport4 -I/home/ripley/R/cc/include -DNDEBUG
-I./libuv/include -I./http-parser -I./sha1 -I./base64
-I/usr/local/include -I"/home/ripley/R/Lib32/Rcpp/include"   -KPIC  -O
-xlibmil -xtarget=native -nofstore  -c websockets.cpp -o websockets.o
"websockets.cpp", line 9: Warning: Last line in file
"./base64/base64.hpp" is not terminated with a newline.
"websockets.cpp", line 289: Error: Could not find a match for
std::ptr_fun<std::_Arg, std::_Result>(extern "C" int(int)) needed in
ltrim(std::string &).
"websockets.cpp", line 295: Error: Could not find a match for
std::ptr_fun<std::_Arg, std::_Result>(extern "C" int(int)) needed in
rtrim(std::string &).
"websockets.cpp", line 295: Error: Could not find a match for
std::ptr_fun<std::_Arg, std::_Result>(extern "C" int(int)) needed in
rtrim(std::string &).
3 Error(s) and 1 Warning(s) detected.
gmake: *** [websockets.o] Error 2