Exit with proper test code on test_erlang, closes #2313