Fix createResource initial value typing

Improved TypeScript type inference for createResource when an initialValue option is provided, so the resource's value type now correctly includes the initial value type. Added type tests to verify the fix works for both cases with and without a source.