core: generic buffer inside/outside/overlapping routine

Remove multiple implementation of "is buffer inside a buffer" and
friends and rely on a generic core_is_buffer_inside/outside/over().

Change-Id: I93e5726de2c2a9407454f2b2a56b53c7331d5c07
Reviewed-on: https://gerrit.st.com/14176
Reviewed-by: Etienne CARRIERE <etienne.carriere@st.com>
Tested-by: Etienne CARRIERE <etienne.carriere@st.com>
uintptr_t or vaddr_t would be a better integer type to use instead of pointer.
If this is moved into libutil I would suggest uintptr_t else vaddr_t.