Crash when adding learn-code accessory
I have one RM pro and one RM (no RF). 

```
Jul 04 13:07:44 homebridge homebridge[13444]: [2018-7-4 13:07:44] [Broadlink RM Living Room] [INFO] Discovered Broadlink RM Mini (2737) at 192.168.1.CD (XX:XX:XX:XX:XX:XX)
Jul 04 13:07:44 homebridge homebridge[13444]: [2018-7-4 13:07:44] [Broadlink RM Living Room] [INFO] Discovered Broadlink RM2 Pro Plus (272a) at 192.168.1.AB (XX:XX:XX:XX:XX:XX)
```


If I do not add learn-code accessory then i see some messages:

```
Jul 04 13:07:55 homebridge homebridge[13444]: [2018-7-4 13:07:55] [Broadlink RM Living Room] Scan Frequency getSwitchState: undefined
Jul 04 13:07:55 homebridge homebridge[13444]: [2018-7-4 13:07:55] [Broadlink RM Living Room] Learn getSwitchState: undefined
Jul 04 13:08:14 homebridge homebridge[13444]: [2018-7-4 13:08:14] [Broadlink RM Living Room] Learn getSwitchState: undefined
Jul 04 13:08:14 homebridge homebridge[13444]: [2018-7-4 13:08:14] [Broadlink RM Living Room] Scan Frequency getSwitchState: undefined
```

If i add the accessory:

```
{
                    "name": " Learn",
                    "host": "XX:XX:XX:XX:XX:XX",
                    "type": "learn-code",
                    "scanFrequency": true
}
```
 then...


```
Jul 04 13:04:26 homebridge homebridge[12960]: [2018-7-4 13:04:26] [Broadlink RM Living Room] [ACTION] Hold down the button that sends the RF frequency.
Jul 04 13:04:34 homebridge homebridge[12960]: [2018-7-4 13:04:34] [Broadlink RM Living Room]  Learn getSwitchState: undefined
Jul 04 13:04:36 homebridge homebridge[12960]: [2018-7-4 13:04:36] [Broadlink RM Living Room] [INFO] Scan RF (scanning)
Jul 04 13:04:36 homebridge homebridge[12960]: [2018-7-4 13:04:36] [Broadlink RM Living Room] [ACTION] Hold down the button that sends the RF frequency.
Jul 04 13:04:47 homebridge homebridge[12960]: [2018-7-4 13:04:47] [Broadlink RM Living Room] [INFO] Scan RF (stopped - 20s timeout)
Jul 04 13:04:47 homebridge homebridge[12960]: /usr/local/lib/node_modules/homebridge-broadlink-rm/helpers/learnRFData.js:135
Jul 04 13:04:47 homebridge homebridge[12960]:       closeClient();
Jul 04 13:04:47 homebridge homebridge[12960]:       ^
Jul 04 13:04:47 homebridge homebridge[12960]: TypeError: closeClient is not a function
Jul 04 13:04:47 homebridge homebridge[12960]:     at Timeout.setTimeout (/usr/local/lib/node_modules/homebridge-broadlink-rm/helpers/learnRFData.js:135:7)
Jul 04 13:04:47 homebridge homebridge[12960]:     at ontimeout (timers.js:427:11)
```


