How to close color Sensor properly?
Looking at the stack trace in the exception you've posted, the error seems to be coming from a call to RemoteEV3.createRegulatedMotor:

at lejos.remote.ev3.RemoteEV3.createRegulatedMotor(Unknown Source)
at test_bluetooth.Bluetooth.main(Bluetooth.java:186)


After that, it's just going through the motions to try and open a port on a remote device...

From looking at the LeJOS source, that method isn't called by the main RemoteEV3 constructor when setting up the ports, so it is probably something you're calling in your main block.

Both Sensors and Motors need to be closed.

As a point of note, it's recommended that instead of connecting to the remote sensors directly as you're doing there, you instead use the createSampleProvider method:

RemoteEV3 ev3 = new RemoteEV3("10.0.1.1");
RMISampleProvider color_sensor = ev3.createSampleProvider("S2",
               "lejos.hardware.sensor.EV3ColorSensor", "Color ID");
float[] color_id= new float[1];
color_sensor.fetchSample(color_id,0);


It is apparently more efficient because instead of running the sensor driver on the PC and sending requests to the remote EV3 you're creating the sensor driver on the remote EV3 and sending the samples to the PC.