Ensure ajax type is set for legacy calls

This sets type=ajax for all legacy requests using ajax.php as entrypoint.

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| Refs tickets  | #1586 
| License       | MIT
| Doc PR        | -