Completely custom timeout approach as suggested by dsaff for #727