Fix incorrect loop timeout being chosen when using the threaded interface and keepalive = 0. Thanks to Gianfranco Costamagna. Bug: https://bugs.eclipse.org/bugs/show_bug.cgi?id=471334