Updated WiFi_Check with improvements

- Improved file locking with flock. Source: https://tobrunet.ch/2013/01/follow-up-bash-script-locking-with-flock/
- Before pinging to determine if we have a Wi-Fi connection, we get the preferred gateway from /etc/network/interfaces