Hangs when stopping playback

Since the upgrade to Kodi 17.1 and Ubuntu 17.04 I have been having issues with Kodi hanging after playback. It happens when a video has played for a while (not if I play it for a few seconds and then stop it) and what exactly happens is that the menu GUI does not appear but the video remains frozen. Inputs from my remote and Yatse do not change anything.

The debug log is on pastebin: https://pastebin.com/xcty5VGU

Does anyone recognize this.