The behavior appears to be much better with the kernel version 4.16-rc6. However, I think this is not 100% solved, as the following error is still (but now rarely) happening when disconnecting from a network:
[ 5934.740004] ath10k_pci 0000:02:00.0: failed to install key for vdev 0 peer xx:xx:xx:xx:xx:xx: -110
[ 5934.740010] wlp2s0: failed to remove key (0, xx:xx:xx:xx:xx:xx) from hardware (-110)
With that MAC address being from the router. I believe this error, when happening on shutdown or reboot, is the source of the problem, as when that messages are not shown (apparently) the error doesn't happens.
The behavior appears to be much better with the kernel version 4.16-rc6. However, I think this is not 100% solved, as the following error is still (but now rarely) happening when disconnecting from a network:
[ 5934.740004] ath10k_pci 0000:02:00.0: failed to install key for vdev 0 peer xx:xx:xx:xx:xx:xx: -110
[ 5934.740010] wlp2s0: failed to remove key (0, xx:xx:xx:xx:xx:xx) from hardware (-110)
With that MAC address being from the router. I believe this error, when happening on shutdown or reboot, is the source of the problem, as when that messages are not shown (apparently) the error doesn't happens.