New functions for default category in project api

project_get_default_category() returns the default category_id for the
specified (or the current) project. It also handles the ALL_PROJECTS
case. If the default category is undefined or invalid, the function
returns 0, except if the project has only 1 category, in which case it
is used as default.

project_set_default_category() updates the project record with a new
default category; for ALL_PROJECT, the value is stored in global config
'default_category_for_moves'

This commit is a prerequisite to resolve #8582
Pre-select default category in bug report page

Use project_get_default_category() to preset the category selection
list with the current project's default.

This is part of the solution for #8582
Allow admin to choose the default category

This commit introduces the possibility for the admin to set the default
category, both globally and for specific projects, by means of a new
action button in the categories list.

Fixes #8582
Use global default category when creating new project
New config option for default Category

A new option $g_use_default_category was added to enable the use of
default categories.

When combined with $g_allow_no_category, the two parameters give the
administrator 4 distinct ways of handling the Category field when
creating new issues:

 - $g_allow_no_category = OFF, $g_use_default_category = OFF
   Category is mandatory, and the user must manually select it from the
   list. This is the MantisBT default (preserves previous behavior).

 - $g_allow_no_category = OFF, $g_use_default_category = ON
   Category is preset to project default, and can't be empty
   In this mode, the category is not mandatory.

 - $g_allow_no_category = ON, $g_use_default_category = OFF
   Category is preset to "(No Category)", project defaults are not used

 - $g_allow_no_category = ON, $g_use_default_category = ON
   Category is preset to project default, but user can change it to
   "(No Category)"

Affects #8582
Use project-default category when moving bug without one

This improves on previous behavior which was relying on global config
default_category_for_moves to set the bug's new category, when the
current one is not applicable in the target project.