That seems to have fixed it! I've run the test script six or seven times on both kernels, with nary a hiccup (aside from the "error -19" messages with the 4.13 kernel). Below is the reported kernel information from both your builds, just to be sure I booted the correct kernels.
$ uname -a
Linux oil-boldore 4.13.0-25-generic #29~lp1733662PatchFromUpstream SMP Wed Jan 17 20:13:36 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
$ uname -a
Linux oil-boldore 4.15.0-041500rc8-generic #201801172011 SMP Wed Jan 17 20:13:51 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
That seems to have fixed it! I've run the test script six or seven times on both kernels, with nary a hiccup (aside from the "error -19" messages with the 4.13 kernel). Below is the reported kernel information from both your builds, just to be sure I booted the correct kernels.
$ uname -a tchFromUpstream SMP Wed Jan 17 20:13:36 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
Linux oil-boldore 4.13.0-25-generic #29~lp1733662Pa
$ uname -a 041500rc8- generic #201801172011 SMP Wed Jan 17 20:13:51 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
Linux oil-boldore 4.15.0-