A callback-to-promise-and-back adapter.