Fix for #791

Fixed issue with search system as described in #791 . Queries created
for search function would be like

```
WHERE `anchor_posts`.`status` = ? AND `anchor_posts`.`title` like ? OR
`anchor_posts`.`html` like ?
```

but if both the title and content of a post contain the search term,
the status check would be overwritten by the OR clause . The solution I
made is a bit ugly so the syntax may need some change, asked for it on
gitter but no replies. Anyway, this is a temporary fix.