layers: Fix "count" tests in swapchain layer.

The swapchain layer was attempting to test if the application gave a value for
a *Count variable (e.g. pSurfaceFormatCount for the
vkGetPhysicalDeviceSurfaceFormatsKHR() function) that was larger than what that
function returned previously (i.e. when the non-count variable was NULL).
However, the test was made after calling down the call-chain, which may modify
the value given by the application.  This test is now made before calling down
the chain.

In addition, a new test is made that tries to ensure that the application did
call the function with the non-Count variable equal to NULL **before** calling
the function with a non-NULL non-Count variable.
3 files changed