With MkR IoT Carrier, the two relays switch on when signal is LOW.
I don't know very well Arduino Wifi 1010 board, but I suppose that, as with other boards, when you define a GPIO pin as OUTPUT, as default value it will setted to LOW, so the relay switch on a little time until you call the method close().
This a well known behaviour and with some board to avoid this is enought enable the pull-up resistor on that gpio BEFORE setting as OUTPUT.