Ensure that the whole file was downloaded.

On unstable connections, a ACK/FIN packet might be fired in the middle of the download.
To get around this, we compare the content-length (if present) with the total number of downloaded bytes.
If they are different an error is thrown, making the whole process to fallback to `git clone`: https://github.com/bower/bower/blob/master/lib/core/resolvers/GitHubResolver.js#L109

Check https://github.com/joyent/node/issues/6143 for more information.

Fixes #792 #824 and probably #830.