Prevents close while opening board (fixes #32)

Before closing the serialport, checks if the board is “ready” (has ben
fully connected, with an existing board & pins, and it is not being
disconected)