Use set_unlock and set_unpin in message index and search - fixes #1805

Signed-off-by: emanuele <emanuele45@gmail.com>