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)