Smart group cache not updating with timeout of 0
With a timeout setting of 0 for the smart group cache, Civi was none-the-less working with a timeout of 5 minutes. When a contact is added, clearContactCaches() is called which does call CRM_Contact_BAO_GroupContactCache::remove(). However smart groups that have not timed out will not be cleared.

To fix my issue I added to clearContactCaches() a call to clear the specific group that might be used immediately, ie:
CRM_Contact_BAO_GroupContactCache::remove(1234);

I also found a bug in GroupContactCache.php in 4.6.18, reported here:
https://issues.civicrm.org/jira/browse/CRM-19005