[lib][web][native] Refactor urlPrefixSelector
Summary: issue: https://linear.app/comm/issue/ENG-5001/refactor-urlprefixselector
Test Plan: Tested that the selector works by calling useSelector(urlPrefixSelector('256')); and printing the result. Tested the openSocketSelector by running the app and checking that it is possible to send messages
Reviewers: michal, kamil, ginsu
Reviewed By: kamil
Subscribers: ashoat, tomek, wyilio
Differential Revision: https://phab.comm.dev/D9681