Various changes to support building in LwIP/FreeRTOS environment.