[TIMOB-17818] make exitOnClose settable at any time

#6263 with doc fix