bugfix for `detail::behavior_stack` + maintenance

this patch fixes an issue in `behavior_stack`: in case handlers are
invoked from cache, the behavior is not copied beforehand