Preserve return values of hooked functions

Thanks to lemtzas for reporting this bug
Pause/resume profiling on the fly