Nissan to close Indonesia, Spain auto plants after losses