Fix exception when fetching empty collections

This crops up especially easily with search queries: no results, no paging;
x-wp-totalpages got set to "0", a string, so the previous null check failed
to catch the lack of pagination and an exception occurred when parsing the
non-existent link header.