Revert use of (bool) typecast

Commit 5458f7020999317b35f403fa2a0e477d6182ec12 replaced several
occurences of db_prepare_bool() by (bool) typecasts. This breaks
compatibility with PostgreSQL, which requires special handling for
BOOLEAN columns.
Consistently use db_prepare_bool() for boolean columns

In Version API, the released column was treated as an integer, despite
the fact that it's defined as 'L' in the schema. This can cause problems
with PostgreSQL.

Also fixes #17333, Oracle throwed an ORA-01400 error when adding a new
version (regression caused by a80f447687722b52160d00c96c21a5be5f4329e1,
which removed the call to db_prepare_bool()).
Update constants to be consistent with underlying db column type

We define constants VERSION_FUTURE = 0 and VERSION_RELEASED = 1
for use with project_version.released column. However, it is defined as
type 'L' which maps to boolean in some DB types.

To prevent errors caused by mismatched data types, the constants are now
using true/false. If we ever need to store more values, the column's
type should be changed to integer in the schema.
Fix handling of boolean columns for PostgreSQL