Add similar logic to salloc as sbatch that was done in commit c396ac202.