Fix/work package queries

Currently, saving a work package query is broken. This is an impediment for https://www.openproject.org/issues/1967. The corresponding issue is https://www.openproject.org/issues/2078.