Fix bug in spark local scratch dir calculation