improve readability after 7bc5438

Streamline a number of ?: cases and make use of fetchColumn() where it
fits.

* getIPv4AddressNetworkId()
* fetchIPv4AddressNetworkRow()
* getIPv6AddressNetworkId()
* fetchIPv6AddressNetworkRow()
* objectTypeMayHaveParent()
* loadScript()
* getFileCache()
* findFileByName()
* getUserIDByUsername()
* getVLANSwitchInfo()