WiFi restart makes my Raspberry Pi3 device go offline until reboot

Just experienced the issue again with the new resin os:

while it is still working the messages are (wlan0 is not used, wlan1 is a usb dongle):

[Thu Nov  9 16:41:43 2017] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
[Thu Nov  9 16:41:43 2017] brcmfmac: power management disabled

Then there is the disconnect:

[Thu Nov  9 16:52:27 2017] RTL871X: linked_status_chk(wlan1) disconnect or roaming
[Thu Nov  9 16:52:34 2017] RTL871X: indicate disassoc
[Thu Nov  9 16:52:39 2017] RTL871X: nolinked power save enter
[Thu Nov  9 16:52:43 2017] RTL871X: nolinked power save leave
[Thu Nov  9 16:52:47 2017] RTL871X: set ssid [XXXXXX] fw_state=0x00000008
[Thu Nov  9 16:52:47 2017] RTL871X: set bssid:XXXXXX
[Thu Nov  9 16:52:47 2017] RTL871X: start auth
[Thu Nov  9 16:52:47 2017] RTL871X: auth success, start assoc
[Thu Nov  9 16:52:47 2017] RTL871X: assoc success
[Thu Nov  9 16:52:47 2017] UpdateHalRAMask8812A => mac_id:0, networkType:0x14, mask:0x000ffff0
	 ==> rssi_level:0, rate_bitmap:0x000ff010
[Thu Nov  9 16:52:47 2017] RTL871X: send eapol packet
[Thu Nov  9 16:52:47 2017] RTL871X: indicate disassoc
[Thu Nov  9 16:52:47 2017] RTL871X: set bssid:00:00:00:00:00:00
\xffffffb71X\xffffffa3Z%]X\xffffffe9^\xffffffd4\xffffffab\xffffffb2\xffffffcdƛ\xffffffb4T\xffffff82tA!=܇2	] fw_state=0x00000008
[Thu Nov  9 16:52:48 2017] RTL871X: indicate disassoc
[Thu Nov  9 16:52:48 2017] IPv6: ADDRCONF(NETDEV_UP): wlan1: link is not ready
[Thu Nov  9 16:52:56 2017] RTL871X: nolinked power save enter
[Thu Nov  9 16:53:12 2017] RTL871X: nolinked power save leave
[Thu Nov  9 16:53:16 2017] RTL871X: nolinked power save enter
[Thu Nov  9 16:53:45 2017] RTL871X: nolinked power save leave
...

Is there an easy way to restart the networking stack from inside the container? Then we could have a script which checks for connectivity and restarts the stack if it gets stuck.