Use new sha1 function with node.js 0.11+ only

This switches node.js 0.10 back to the old sha1 function due to
some bugs in early node.js 0.10 versions.

node.js >= 0.10.0 < 0.10.5 throw an error from `hash.setEncoding`
node.js 0.10.5 does not honor `hash.setEncoding` for `hash.write`
and the string is interpreted as utf8 and corrupted.

fixes #746
fixes #752