fixed camera code not checking for invalid/missing datablock: crashed before
fixed pointer problems and guard in material files
added checks for valid pointers after locking
Merge pull request #420 from tdev/camera-datablock-fixes

fixed camera code not checking for invalid/missing datablock
Merge pull request #423 from tdev/material-ptrs

fixed pointer problems and guard in material files
Merge pull request #424 from tdev/lock-checking

Added checks for valid pointers after locking