Promisify a callback-based function