Properly send 201 on PUT requests when resource didn't exist

Regardless of whether a location header has been set, as explained
in the HTTP RFC.