res_pjproject: Add utility functions to convert between socket structures