Clean up when returning from d2vCreate with an error

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Check for errors after invoking ApplyRFF

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
d2vsource: Fix usage of non-existent API function

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Only declare variables at block start

Mixed code and declarations were accidentally introduced
in 6f457aa9e780a8f2675ce118b352cf974f96378f.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>