Improve retry logic in the server check. Fixes #14

Also change default hostname from `localhost` to `127.0.0.1`. They're in almost all cases the same, so shouldn't break anything.
0.3.0