a simple "run with timeout" mechanism