CLOUDSTACK-5638: Fixed code to check router state