Handle misformatted versions with a nicer error message.

Fixes https://github.com/rust-lang/cargo/issues/61.