multipathd: move helper functions to libmultipath