Revised 2003r2 farm compatibility support

Hack to avoid exiting due to an invalid file descriptor may cause instability
Tested (but not exhaustively) with farm 2003r2, 2008r2 for token & ip based routing