Fix slow library search on sqlite 3.8.

(cherry picked from commit 56dade25981da1656cbb68447e8518529e229978)

Conflicts:
	src/library/libraryquery.cpp
Add explanatory comment to last commit.

(cherry picked from commit 5fffbbc6898dc8373d6fd5bf28d4cd79d6f089d5)
Fix compiling 1.2 branch on GCC 4.9
Bump 1.2 release version
Bump changelog for 1.2.3

(cherry picked from commit 2e61ef9b178b20652590832b7d36038c73d0bbf5)