Fix hs_try_putmvar losing track of running cap

If hs_try_putmvar was called through an unsafe import, it would lose track of the running cap causing a deadlock
29 jobs for !2311 with hs_try_putmvar in 1173 minutes and 47 seconds (queued for 2 seconds)
latest detached
Status Job ID Name Coverage
  Lint
passed #247902
lint
ghc-linters

00:01:10

passed #247903
lint
lint-linters

00:01:10

passed #247906
lint
lint-submods-mr

00:00:16

passed #247904
lint
lint-testsuite

00:00:17

passed #247905
lint
typecheck-testsuite

00:00:16

 
  Quick Build
passed #247907
x86_64-linux
hadrian-ghc-in-ghci

00:19:34

 
  Build
passed #247908
x86_64-linux
validate-x86_64-linux-deb9-hadrian

03:08:35

 
  Full Build
failed #247911
aarch64-linux allowed to fail
validate-aarch64-linux-deb9

04:18:53

passed #248322
armv7-linux
validate-armv7-linux-deb9

03:51:13

passed #247913
x86_64-linux
validate-i386-linux-deb9

01:49:05

passed #247910
x86_64-darwin
validate-x86_64-darwin

01:07:50

passed #248598
x86_64-linux
validate-x86_64-linux-deb9-debug

04:27:43

passed #247916
x86_64-linux
validate-x86_64-linux-deb9-dwarf

01:45:57

passed #247915
x86_64-linux
validate-x86_64-linux-deb9-integer-simple

01:11:03

passed #247909
x86_64-linux
validate-x86_64-linux-deb9-unreg-hadrian

04:33:49

passed #247917
x86_64-linux
validate-x86_64-linux-fedora27

01:39:39

passed #249233
x86_64-windows
validate-x86_64-windows

02:41:18

failed #247918
x86_64-windows allowed to fail
validate-x86_64-windows-hadrian

00:00:00

failed #248185
armv7-linux
validate-armv7-linux-deb9

03:52:16

failed #247912
armv7-linux
validate-armv7-linux-deb9

04:14:34

failed #247914
x86_64-linux
validate-x86_64-linux-deb9-debug

05:00:00

failed #248186
x86_64-linux
validate-x86_64-linux-deb9-debug

04:11:36

failed #248323
x86_64-windows
validate-x86_64-windows

03:07:19

failed #248187
x86_64-windows
validate-x86_64-windows

02:39:25

failed #247919
x86_64-windows
validate-x86_64-windows

00:00:00

 
  Cleanup
passed #247920
x86_64-darwin
cleanup-darwin

00:00:09

 
  Packaging
passed #247921
x86_64-linux
doc-tarball

00:05:46

 
  Testing
manual #247922
x86_64-linux allowed to fail manual
hackage
passed #247923
x86_64-linux
perf-nofib

00:23:51

 
Name Stage Failure
failed
validate-aarch64-linux-deb9 Full Build
Uploading artifacts...
ghc-aarch64-linux-deb9.tar.xz: found 1 matching files
junit.xml: found 1 matching files

performance-metrics.tsv: found 1 matching files

Uploading artifacts to coordinator... ok
id=247911 responseStatus=201 Created token=b4kBTCAs
Uploading artifacts...
junit.xml: found 1 matching files

Uploading artifacts to coordinator... ok
id=247911 responseStatus=201 Created token=b4kBTCAs
ERROR: Job failed: exit code 1
failed
validate-x86_64-windows-hadrian Full Build There has been a runner system failure, please try again
Running with gitlab-runner 11.10.1 (1f513601)
on ghc-gitlab-windows-3 78d7d3f9
Using Shell executor...
Running on GHC-GITLAB-WIND...
ERROR: Job failed (system failure): write C:\Users\gitlab\AppData\Local\Temp\build_script021504508\script.cmd: There is not enough space on the disk.