Add a utility function to invoke a given callback after a specified timeout

This is a generalization of QTimer::singleShot() which provides
a way to invoke arbitrary functions after a given time.