Minor update to the SWI-Prolog adapter file (clean code that reads terms from a stream)