Callback functions now take both error & result

This simplify the API (only one function to provide)
and allow easy transformation into promises & Cie.

Reported-by: phsiao2000
Signed-off-by: Étienne Vallette d'Osia <evo@zenexity.com>