Re-factoring of service processing code in AS-REQ

Take one step toward re-factoring of the KDC code:
keep the service principal related code in one place.

The code pattern was changed from:
   - unparse client -
   - unparse service -
   - db_get_ client -
   - client referrals -
   - db_get_ service -
   - validate policies etc
into:
   - unparse client -
   - db_get_ client -
   - client referrals -
   - unparse service -
   - db_get_ service -
   - validate policies etc