[luci-app-openvpn] Optimized code and added suggested fix from #650