core: added z_context:prune_for_spawn/1. Fixes #645