I'm getting what seems to be bug 996, however the only version of WinSCP I've (ever) used is 5.5.1 which, according to the bug page, should be fixed.
Here's what happens: when I run my program, which attempts connections over sftp about every minute, after a few hours to a few days I end up getting the following error message:
WinSCP.SessionLocalException: WinSCP process terminated with exit code 3 and output "", without responding (response log file (....)\23\wscp09D0.0399D345.tmp was not created). This could indicate lack of write permissions to the log folder or problems starting WinSCP itself.
at WinSCP.Session.Open(SessionOptions sessionOptions)
Fixes for this bug seemed to be upgrading to a new version of WinSCP and restarting the server, however I have only used a recent version and the machine I am trying to run the service on has been recently restarted, so these solutions do not help.