Copied straight from https://github.com/then/promise/blob/master/src/node-extensions.js but without anything else attached.
Converts a function that returns a promise into one that calls an error-first callback when the promise is resolved.
var nodeify = var doThing =