server: Avoid writing out of bounds in get_selector_entry().