service: helper function for sorting services

Created a helper function to sort service list, to shorten the code
slightly and to ensure null pointer check is always done before using
the list pointer.

[connman] service: helper function for sorting services
Merge pull request #64 from hmallat/service-list-sorting-fix

service: helper function for sorting services