Make sure search params are preserved on redirects
Trying to fix the locking bug.
So far we've seen in logs the locking happens because some times the user is redirected by CodiMD when getting a note. When that happens, the search parameters (which include the token) are lost.
This PR makes sure the parameters are preserved when such redirects happen.