Wraps sync functions to make them non-blocking and leaves async functions unchanged.