frontend: Avoid ratelimit panic
Created by: ryanslade
We weren't checking whether there was a error calculating cost before performing rate limiting. This led us to read cost.FieldCount on a nil cost. Instead, we now only rate limit valid requests.
Also, fixed the source of the cost error in the case that triggered this by treating nil limits as a limit of zero.