Close the input scanner to prevent resource leaks