Move join_with_timeout into the utils module