Dict Lock, default timeout and schedule test check.

The data structure controller dictionary is being shared between IPC and
main thread, so put a lock on it when it is being used by one of them.

The timeout initial value for a test was set to 0.0 which is changed to
current time.

A flag was checked before a test was scheduled on a controller. Due to
modified control flow this condition will not arise so removed the flag
check from the schedule_test function.

Signed-off-by: Srijan Mishra <srijan23mishra@gmail.com>
Acked-by: Joe Stringer <joestringernz@gmail.com>
Keep count of devices connected to controllers.

To elect new master controller in case the master controller goes down,
the controller with maximum devices associated with it will be promoted.
To facilitate this, RFMonitor will maintain the count of the number of
devices associated with it.

Signed-off-by: Srijan Mishra <srijan23mishra@gmail.com>