Adjust line delimiter, correct end of headres search

After some research, i submit this pull request to make it work with current arduino and Thin webserver.
Most credits go to https://github.com/salanki