Fix single threaded tests in off-chain environment (#382)

* [core] fix single threaded tests

Tests that have been run using:
cargo test -- --test-threads=1

* [lang] fix off-chain testing for contracts
15 jobs for master in 5 minutes and 10 seconds (queued for 34 seconds)
Status Job ID Name Coverage
  Check
passed #479068
linux-docker
check-std

00:01:33

passed #479069
linux-docker
check-wasm

00:02:09

 
  Workspace
passed #479070
linux-docker
build-std

00:01:47

passed #479071
linux-docker
build-wasm

00:02:15

passed #479073
linux-docker
clippy-std

00:01:41

failed #479074
linux-docker
clippy-wasm

00:00:57

passed #479075
linux-docker
fmt

00:00:20

passed #479072
linux-docker
test

00:02:58

 
  Examples
skipped #479078
linux-docker
examples-clippy-std
skipped #479079
linux-docker
examples-clippy-wasm
skipped #479080
linux-docker
examples-contract-build
skipped #479077
linux-docker
examples-fmt
skipped #479081
linux-docker
examples-generate-metadata
skipped #479076
linux-docker
examples-test
 
  Publish
skipped #479082
linux-docker
publish-docs
 
Name Stage Failure
failed
clippy-wasm Workspace
Some errors have detailed explanations: E0432, E0583.
For more information about an error, try `rustc --explain E0432`.
error: could not compile `regex`.

Caused by:
process didn't exit successfully: `/usr/local/rustup/toolchains/nightly-2020-04-07-x86_64-unknown-linux-gnu/bin/clippy-driver rustc --crate-name regex /ci-cache/ink/cargo/clippy-wasm/registry/src/github.com-1ecc6299db9ec823/regex-1.3.7/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type lib --emit=dep-info,metadata,link -C debuginfo=2 --cfg 'feature="aho-corasick"' --cfg 'feature="default"' --cfg 'feature="memchr"' --cfg 'feature="perf"' --cfg 'feature="perf-cache"' --cfg 'feature="perf-dfa"' --cfg 'feature="perf-inline"' --cfg 'feature="perf-literal"' --cfg 'feature="std"' --cfg 'feature="thread_local"' --cfg 'feature="unicode"' --cfg 'feature="unicode-age"' --cfg 'feature="unicode-bool"' --cfg 'feature="unicode-case"' --cfg 'feature="unicode-gencat"' --cfg 'feature="unicode-perl"' --cfg 'feature="unicode-script"' --cfg 'feature="unicode-segment"' -C metadata=d4d6b3db3ba2f86e -C extra-filename=-d4d6b3db3ba2f86e --out-dir /ci-cache/ink/targets/master/clippy-wasm/debug/deps -L dependency=/ci-cache/ink/targets/master/clippy-wasm/debug/deps --extern aho_corasick=/ci-cache/ink/targets/master/clippy-wasm/debug/deps/libaho_corasick-78d93fa2c5b4aabe.rmeta --extern memchr=/ci-cache/ink/targets/master/clippy-wasm/debug/deps/libmemchr-3daf40e1f337e844.rmeta --extern regex_syntax=/ci-cache/ink/targets/master/clippy-wasm/debug/deps/libregex_syntax-1fe39bede9c6f6f8.rmeta --extern thread_local=/ci-cache/ink/targets/master/clippy-wasm/debug/deps/libthread_local-a3521d504bd8f290.rmeta --cap-lints allow` (exit code: 1)
warning: build failed, waiting for other jobs to finish...
error: build failed
ERROR: Job failed: exit code 1