Use 'read -n' instead of 'head -c' to improve compatibility

Fixes #519. The delimiter is a bit of a hack, the documentation for read would seem to indicate that -r would cause read to ignore newlines, but it doesn't seem to work on either OS X 10.9 or OpenBSD 5.4, so I chose this approach instead. 

* All tests pass on OS X 10.9. 
* The fix works on OpenBSD 5.4, but I don't have any tests working there yet, I'm getting a lot of "env: bash: No such file or directory" errors when I run 'bats test' there. 

Probably shouldn't merge until I can get the tests working on OpenBSD 5.4. Down the rabbit hole I go...