Check for missing username or password before even hitting the server

Fixes #584