*: support purging old wal/snap files

Fix #1764
if MaxOldSnapFiles <= 0 && s.cfg.MaxOldWALFiles <= 0, this function could return directly instead of waiting on select.