Fix HTTP status code for internal server errors
Ensure that an HTTP status code equal to 500 is returned in case of internal server error when querying the swh Web API.
Also add a test to check returned status codes and update some.
Migrated from D2219 (view on Phabricator)