remove some more mysqlisms

found some more places which are/were mysql-specific. On the plus side, I am running IP on sqlite for some days now and besides the changes below, found no obvious problems so far.