Add handy function to deal with sync callbacks and process.nextTick weakness