Improve and fix bench test
Introduce core.set_is_malloc_allowed(), use it in tests and document it