I'm still struggling with this issue. The only thing I found meanwhile is that the same thing occurs sometimes for a TCP client connecting to api.thingspeak.com. Sometimes the call (send() via TCP) works without issues (ane the request is received by thingspeak server), and sometimes, just after the write() I get the call registered by espconn_reg_reconn_cb (). Of course, in this situation the wi-fi connection works correctly. I'm not yet sure if this is a problem with the client (esp8266) or the server (thingspeak).
One more thing: the wi-fi reconnect seems to be related to the version of my software that is flashed to espressif. I wonder if there can be some memory value, which should be cleared directly, but it is not - and it's value is random and depends on the code being flashed into memory. Something like
stationConf.bssid_set = 0;
which is not obvious to set. Do you know any other 'gotchas' like that?