dispatch_connection: fix infiniteloop in certain cases

This is the fix for issue #8.  When the buffer contains only whitespace,
the loop would never detect it needed more input, therefore running into
an infinite loop, with obvious problems as result.

Thanks a lot to pkittenis for his support and providing the information
through debugging to find this nasty logic error.