Wrap asynchronous callbacks with a timeout checker to prevent them from hanging indefinitely