Improved call_program with more precise timeout granularity