Improve handling of source-file level `set_logtalk_flag/2` directives