Improved fcall() function for implementing promise-based tracers