Fix Invalid rule expression highway!=residential & a ~ b

To make this work we have to prepend a highway!=* term to the expression.
This is done in most circumstances already but this expression happens
to involve a different code path.

Test added.

git-svn-id: http://svn.mkgmap.org.uk/mkgmap/trunk@3071 25d90789-57f7-4ee0-8453-03a3dfeeeb22
Fix various problems that could occur when reading a file with no final eol
or with CR line endings.

Plus a few tests for the different cases.

git-svn-id: http://svn.mkgmap.org.uk/mkgmap/trunk@3072 25d90789-57f7-4ee0-8453-03a3dfeeeb22