try to make reading a bit more reliable

a lot of our out of sync issues come from when we read an empty packet.
so, try harder to find something to read when that happens.
make it a warning to receive no input when reading
apparently YAML.pm no longer likes JSON (fixes #120)

no idea when this happened