Do not match subnets if no networks defined

Server will now skip looking for subnets on shared networks
if the server doesn't have any networks defined. Added tests
to verify existing behavior as well as to guard regression.

Change-Id: I81bc3bf753843f521ccb8a96b9a40a6f82ca8d92
Closes-Bug: #1380846
Merge "Do not match subnets if no networks defined"