core_rpc_server: fix overreads in slow_memmem

It would read data outside the allocated space in a couple cases.
tests: add a test for slow_memmem
core_rpc_server: use do while(0) idiom in macros using if
fixed conflict in tests CMakeLists
Merge branch 'moneromooo-monero-memmem'