Name the arguments in the function call and other fixes
- Close the DB session at the end of the function
- Log to the terminal the project for which we're running the hooks
(this way it will show up in the error email when a merge PR task fails)
- Ensure there is a project, should never be triggered though
Signed-off-by: Pierre-Yves Chibon <pingou@pingoured.fr>