[haptic] Make haptic policy (settings, calls) reusable

Extract the settings and call handling from the ffmemless
plugin to a reusable function in haptic.{c,h} for use by
other plugins.