[api] move release_package function to helper
[api] drop obsolete check of releasetargets, but fix update of release trigger mode instead
[api] support manual package release according to Fate #315081

This requires that the repository release target is defined and the trigger is set to "manual".
Comes with some cleanups of code